0

I have my Parquet file in S3. I want to load this to the redshift table. I don't know the schema of the Parquet file.

Is there any command to create a table and then copy parquet data to it?

Also, I want to add the default time column date timestamp DEFAULT to_char(CURRDATE, 'YYYY-MM-DD').

gavisic
  • 59
  • 1
  • 7

1 Answers1

0

You need first to create an external schema. Normal colunar schemas do not support parquet files. Them you need to create a external table to support the columns on the s3 file. So look for a good relation between the file and datatypes. I usually avoid smalls ints for example. To floats create as REAL data type. Then, do the copy command bellow:

COPY schema_name.table_name 
FROM bucket_object iam_role user_arn 
FORMAT PARQUET;
Mensch
  • 487
  • 7
  • 19