Reputation: 300
I have csv file containing 50k records, my Table format looks like below. I created stage in Snowflake
to load that file. Next,I have 7 different regions, so I would like create 7 different csv file based on region and download those CSV files to my computer. For this I used CLUSTER BY
function in Snowflake
to create cluster based on Region. I am new to snowflake so not sure where should I go from here ? How to view and download the clustered data from Snowflake
? Below is my code so far
Thanks in advance for your time and efforts!
Code so far
ALTER TABLE TABLE1 CLUSTER BY (REGION)
Upvotes: 0
Views: 163
Reputation: 466
This is not how you use clustering in Snowflake so you may want to undo that.
To create a CSV file per region on your table, you can do it interactively in Snowflake UI, just run a query per region and download the result set.
select * from TABLE1 where REGION = 'A';
And then there is a download button in the Result pane.
Classic UI:
Upvotes: 1