Data Transfer - Python to Snowflake

161 Views Asked by At

Edit 1 - We have created a python script which will read a data from excel/csv using pandas and then, will be cleaning it. After cleansing of the data, it will connect to snowflake server and append the data in a table which is already available in snowflake. Now the question is -

In this process of transferring data from python to snowflake. But would I need to ensure that columns names in pandas dataframe should be same (case-sensitive) as column names in snowflake? Or, any case would work to push the data?

1

There are 1 best solutions below

1
Suyash On

There are many steps involved in importing data into a snowflake:

  1. Opening the Data Load Wizard:
    a.Click on Database -> Tables
    b.Click on

    1. Table Row to select it and Load Data
    2. Table Name to select it and Load Table
  2. Selecting a Warehouse:
    a. Select a Warehouse from the dropdown list to include any warehouse on which you have the USAGE privilege. Snowflake will use this warehouse to load data into the table.
    b. Click Next
    Selecting a Source Files:
    The users can load the local machine or cloud storage data like AWS S3, Google Cloud Storage, and Azure.
    a.Local Machine:
    i. Load files from the computer
    ii. Select one or more files and click on Open
    iii. Click on Next
    Cloud Storage: 1.Existing Stage: (i) Select the name of the existing stage and then select the Next button
    New Stage: Click the plus (+) symbol beside the Stage dropdown list. Select the location where your files are located: Snowflake or any one of the supported cloud storage services, and click the Next button. Complete the fields that describe your cloud storage location. Click the Finish button. Select your new named stage from the Stage dropdown list. Click the Next button.

  3. Select File Format: Select a named set of options that describes the format of the data files.
    Existing Name Format: Select the name of the existing file from the dropdown list. Click on the Next Button. New File Format: Beside the dropdown list, select the (+) button. Update the fields according to the files’ format. Click on Finish. Select the new named file format from the dropdown list. Click on Next Select the Load Options Specify how Snowflake should behave if there are errors in the data files. Click on the Load button. This will prompt Snowflake to load the data in the selected table in the required warehouse. Click on Ok.

I guess you, it helps you a lot.