wilkux
wilkux

Reputation: 125

Snowflake mapping columns names from CSV files

I have a table in Snowflake that have 24 columns in it. And I also have a CSV files in the S3 bucket with the changing number of columns. Sometimes it can be 4 columns and sometimes it can be 24 columns etc. I need also map the names of the CSV files columns to the name of the Snowflake table columns. Is there any way how to do it?

Upvotes: 1

Views: 1426

Answers (1)

Clark Perucho
Clark Perucho

Reputation: 466

You would need to pre-process your CSV file to bring it to a more consistent format as your target table.

You can extract the column header and generate a COPY command mapping those columns into your table.

Upvotes: 1

Related Questions