Reputation: 11
I have a table in redshift with following columns in create statement
ExpiryDate Timestamp without time zone NULL Encode zstd,
IssueDate Timestamp without time zone NULL Encode zstd,
RewardNumber varchar(64) NULL Encode zstd,
VoucherIdentifier varchar(64) NULL Encode zstd
Once I insert data into my table I can see NULL value for "ExpiryDate" and "IssueDate" but I have no clue why I am not able to see any NULL value for "RewardNumber" and "VoucherIdentifier". It simply shows blank for the two columns. I am using DBvisualizer to connect to redshift.
Am I doing something wrong when I am creating my tables
Upvotes: 1
Views: 5519
Reputation: 2819
COPY has an optional parameter EMPTYASNULL.
Indicates that Amazon Redshift should load empty CHAR and VARCHAR fields as NULL. Empty fields for other data types, such as INT, are always loaded with NULL. Empty fields occur when data contains two delimiters in succession with no characters between the delimiters. EMPTYASNULL and NULL AS '' (empty string) produce the same behavior.
My hypothesis is that you didn't specify that option when loading your table.
Reference Data Conversion Parameters
Upvotes: 1