0
votes

I need to load data with a default value column into Redshift, as outlined in the AWS docs.

Unfortunately the COPY command doesn't allow loading data with default values from a parquet file, so I need to find a different way to do that.

My table requires a column with the getdate function from Redshift:

         LOAD_DT TIMESTAMP DEFAULT GETDATE()

If I use the COPY command and add the column names as arguments I get the error:

     Column mapping option argument is not supported for PARQUET based COPY

What is a workaround for this?

1

1 Answers

1
votes

Can you post a reference for Redshift not supporting default values for a Parquet COPY? I haven't heard of this restriction.

As to work-arounds I can think of two.

  1. Copy the file to a temp table and then insert from this temp table into your table with the default value.
  2. Define an external table that uses the parquet file as source and insert from this table onto the table with the default value.