For the sake of exemplifying, let's say I have a parquet file in s3 partitioned by column date with the following format:
s3://my_bucket/path/my_table/date=*
So when I load the table using spark, for example, it shows the following:
+---+-------+--------+
| id|country| date|
+---+-------+--------+
| 1| Italy|20200101|
| 2| France|20200101|
| 3| Japan|20200102|
| 4| USA|20200103|
+---+-------+--------+
I am trying to load this table into Redshift doing something like this:
create table my_table
(
id BIGINT ENCODE az64,
country VARCHAR(256) ENCODE lzo,
date VARCHAR(256) ENCODE lzo
);
copy my_table
from 's3://my_bucket/path/my_table/'
iam_role 'my-role'
format as parquet
partition by 'date';
Is there a way to insert this data into RS using the command COPY or any other method?
*I already tried using manifest file, but could not to a find a way to load the partition column as well