How do you load data into a stage in Snowflake?

103 viewsData Loading and Unloading
0

How do you load data into a stage in Snowflake?

Daniel Steinhold Changed status to publish August 19, 2023
0

There are two ways to load data into a stage in Snowflake: using the PUT statement or using the Snowsight user interface.

To load data into a stage using the PUT statement, you need to specify the following:

  • The name of the stage
  • The path to the file that you want to load
  • The file format of the data in the file

The following is an example of a PUT statement for loading a CSV file into an internal stage:

PUT file:///path/to/file.csv @my_stage;

The following is an example of a PUT statement for loading a JSON file into an external stage:

PUT s3://my-bucket/my-file.json @my_external_stage;

To load data into a stage using Snowsight, you need to follow these steps:

  1. Go to the Snowsight user interface.
  2. Click on the Data tab.
  3. Click on the Stages tab.
  4. Click on the name of the stage that you want to load data into.
  5. Click on the Load Data button.
  6. Select the file that you want to load.
  7. Click on the Load button.

Once you have loaded the data into the stage, you can use it to load or unload data into or out of Snowflake.

Here are some additional things to keep in mind when loading data into a stage:

  • The file that you are loading must be in a supported file format.
  • The file that you are loading must be accessible by Snowflake.
  • If you are loading data into an external stage, you must have the appropriate permissions to access the external location.
Daniel Steinhold Changed status to publish August 19, 2023
You are viewing 1 out of 1 answers, click here to view all answers.