Skip to Content

Snowflake

In an application, right-click on Sources -> select Create source -> type any Source name and select SnowflakeSource in the Source type field -> click Create.

  • connStr - connection string, e.g. jdbc:snowflake://<account_identifier>.snowflakecomputing.com/?warehouse=COMPUTE_WH&db=PADB_TEST&schema=public. You can find more details at https://docs.snowflake.com/en/user-guide/jdbc-configure 
  • authenticator: oath - OAuth Client Credentials flow (requires oauthClientId, oauthClientSecret, oauthScope, oauthAccessTokenUrl); snowflake - internal Snowflake authenticator (requires user and password)

Upload file to an internal stage

Use LoadTableFromSource (aka Load) operation:

  • Set the source parameters to point to a file to load
  • Set the source Content format to binary
  • Set the target source to a source of the SnowflakeSource type
  • Target space must have the follow format @stage/<stageName>/<destPrefix can include slashes> (eg @stage/ENTERWORKS.STG_ENTERWORKS_DEV/tmp/t1 or @stage/ENTERWORKS.STG_ENTERWORKS_DEV/)
  • Target table is a file name (eg sfdc_accounts_ext.csv)
  • Set the target content format to binary.

Notice that if you load a file with compression enabled (enabled by default), the uploaded file will have the following name: <name-of-file>.gz (eg sfdc_accounts_ext.csv.gz). This is the name you should use when you later download file.

You can disable compression (enabled by default) by setting the following Target source options:

{"compress":"false"}

To view a list of files in a stage: right-click on a SnowflakeSource source -> Select Console -> Use list command (eg list @ENTERWORKS.STG_ENTERWORKS_DEV/)

Download file from an internal stage

Use LoadTableFromSource (aka Load) operation:

  • Set the source to a source of the SnowflakeSource type
  • Source space must have the follow format @stage/<stageName>/<destPrefix can include slashes> (eg @stage/ENTERWORKS.STG_ENTERWORKS_DEV/tmp/t1 or @stage/ENTERWORKS.STG_ENTERWORKS_DEV/)
  • Source table is a file name. It must end with .gz if you used compression on upload (eg sfdc_accounts_ext.csv.gz). If the file name is incorrect Load operation will hang without throwing an error.
  • Set the source Content format to binary.
  • Set the target source parameters to where the downloaded file should be stored
  • Set the target source Content format to binary

You can disable decompression (enabled by default) by setting the following source options:

{"decompress":"false"}
Last updated on