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 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}})
-
Create an RDBMS database or data warehouse import.
-
Provide the modelMetadata with NULL as the default (no quotes: " ") or NULL for some fields that won't get exported.
-
Import the data.
-
Verify that the imported data contains the NULL values for the respective columns.