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
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Account address (URL) | String | No | Your Snowflake account address, e.g. https://myorg-myaccount.snowflakecomputing.com. | |
| Table name | String | Yes | Table to load into, written as DATABASE.SCHEMA.TABLE (or just TABLE with database and schema set). | |
| File | File | Yes | A CSV or Parquet file on this machine, or a path on a stage such as @MY_STAGE/orders/ (then nothing is uploaded). | |
| Stage | String | No | Named stage to put a local file on; the table's own stage when empty. The uploaded copy is removed once it is loaded. | |
| Format | String | No | csv | csv (comma-separated, values may be in double quotes) or parquet (columns matched to the table's by name). |
| Skip header | Number | No | 1 | Lines at the top of a CSV file that are not data, such as the column names. |
| On error | String | No | abort | On 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 limit | Number | No | 1 | The number of bad rows, or the percent of bad rows, after which a file is skipped. |
| Wait (seconds) | Number | No | 3000 | How long to wait for each statement to finish. |
| Warehouse | String | No | Warehouse that runs the query. Leave empty for the user's default warehouse. | |
| Database | String | No | Database of the table when table_name has no database. | |
| Schema | String | No | Schema of the table when table_name has no schema. | |
| Role | String | No | Role to run as. Leave empty for the user's default role. | |
| Token | Credential | No | Access 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 type | String | No | OAUTH | Kind of token in the vault: OAUTH, KEYPAIR_JWT or PROGRAMMATIC_ACCESS_TOKEN. |
Outputs
| Output | Type | What it is |
|---|---|---|
| rows_loaded | Number | Rows added to the table. |
| errors_seen | Number | Bad rows Snowflake found (skipped ones included). |
| results | Table | Snowflake's result: one row per file with its status, rows loaded and first error. |
| statement_handle | String | Id of the copy statement. |