Ankit Srivastava
Ankit Srivastava

Reputation: 195

Snowflake Copy Into failing when insert Null in timestamp column

Trying to load file data into Snowflake using COPY INTO. The table has a timestamp column. The file has only Null's empty string "" in that column.

On running copy into with File Format Timestamp option set AUTO, the statement is failing stating Can't parse '' as timestamp.

Is there any way to handle this

Upvotes: 2

Views: 2569

Answers (1)

Lukasz Szozda
Lukasz Szozda

Reputation: 175566

Using NULL_IF option:

NULL_IF = ( 'string1' [ , 'string2' ... ] )

String used to convert to and from SQL NULL. Snowflake replaces these strings in the data load source with SQL NULL. To specify more than one string, enclose the list of strings in parentheses and use commas to separate each value.

NULL_IF = ('\\N', '')

Upvotes: 2

Related Questions