Articles in this section

Handling NULL values while using handlebars

NULL values in the export records are being translated to empty strings " " after evaluating handlebars. This may cause issues while importing records if the column type is not text-based. There are several ways to handle this issue.

Note: Redshift will throw an error if the column type differs from the provided value.

Use an IF…ELSE handlebar

Use an IF…ELSE handlebar to transform an empty string to a NULL handlebar.

  INSERT into tableName(fieldNameOne, fieldNameTwo) values({{#if record.fieldNameOne}} {{record.fieldNameOne}} {{else}} NULL {{/if}}, {{record.fieldNameTwo}})

Screenshot 2023-10-30 at 12.36.29 PM.png

Provide NULL in a default values section

  1. Create an RDBMS database or data warehouse import.
  2. Provide the modelMetadata with NULL as the default (no quotes: " ") or NULL for some fields that won't get exported.

Screenshot (218).png

  1. Import the data.
  2. Verify that the imported data contains the NULL values for the respective columns.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.