Skip to main content

Load file into table

Load a CSV or Parquet file into a table: a file on this machine is first put on the table's stage or a named stage, a file already on a stage is used as it is; then Snowflake copies it in (G6).

Command in the Snowflake toolkit · id ooa.snowflake/load_file · 15 inputs (2 required), 4 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Account address (URL)StringNoYour Snowflake account address, e.g. https://myorg-myaccount.snowflakecomputing.com.
Table nameStringYesTable to load into, written as DATABASE.SCHEMA.TABLE (or just TABLE with database and schema set).
FileFileYesA CSV or Parquet file on this machine, or a path on a stage such as @MY_STAGE/orders/ (then nothing is uploaded).
StageStringNoNamed stage to put a local file on; the table's own stage when empty. The uploaded copy is removed once it is loaded.
FormatStringNocsvcsv (comma-separated, values may be in double quotes) or parquet (columns matched to the table's by name).
Skip headerNumberNo1Lines at the top of a CSV file that are not data, such as the column names.
On errorStringNoabortOn a bad row: abort (load nothing), continue (load the good rows), skip_file (leave out the file), or skip the file once it has on_error_limit bad rows or that percent of bad rows.
On error limitNumberNo1The number of bad rows, or the percent of bad rows, after which a file is skipped.
Wait (seconds)NumberNo3000How long to wait for each statement to finish.
WarehouseStringNoWarehouse that runs the query. Leave empty for the user's default warehouse.
DatabaseStringNoDatabase of the table when table_name has no database.
SchemaStringNoSchema of the table when table_name has no schema.
RoleStringNoRole to run as. Leave empty for the user's default role.
TokenCredentialNoAccess token from the vault: an OAuth token, a key-pair JWT or a programmatic access token. Or leave it empty and choose a connection that signs in, which gets and renews the token.
Token typeStringNoOAUTHKind of token in the vault: OAUTH, KEYPAIR_JWT or PROGRAMMATIC_ACCESS_TOKEN.

Outputs​

OutputTypeWhat it is
rows_loadedNumberRows added to the table.
errors_seenNumberBad rows Snowflake found (skipped ones included).
resultsTableSnowflake's result: one row per file with its status, rows loaded and first error.
statement_handleStringId of the copy statement.