snowflake-cloud-data-platformsnowflake-schema

How to view and download the Clustered data from Snowflake?


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!

enter image description here

Code so far

ALTER TABLE TABLE1 CLUSTER BY (REGION)

Solution

  • 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:

    enter image description here

    Snowsight UI: enter image description here