Pranay K
Pranay K

Reputation: 13

Practical method to fetch data from snowflake to excel file based on one of the column

I have an excel file with a column consisting of ID numbers (around 160k rows). I have to fetch some data related to these IDs from Snowflake. Different columns need various data tables. The tables have around 250k entries each. What is the best way to fetch the data from these tables to the excel file?

I tried loading the excel file into a pandas dataframe and then using pandas read_sql method to iterate through the IDs and fetch the corresponding data. This is extremely slow given the size of the data. Is there any practical way to approach this?

Excel File format (an example)

Upvotes: 1

Views: 2465

Answers (1)

Marcel
Marcel

Reputation: 2612

I understand you do not want to load the excel to Snowflake, but the Snowflake data to your excel file.

If this is correct, here are some ways of how to bring Snowflake data to an excel file:

  1. Use COPY INTO to export the data to a CSV file in one of your internal stages and then download with GET: https://docs.snowflake.com/en/sql-reference/sql/copy-into-location.html
  2. Connect your excel file to Snowflake via „Data > From other sources“ and the ODBC Driver
  3. Run SELECT in Snowflake and simply download the result set with the download button

Upvotes: 1

Related Questions