Snowflake
Configuration reference for the Snowflake batch source: warehouse and role setup, password vs. key-pair authentication, source options, and cost-control guidance.
Snowflake is a cloud-native data warehouse. Nilus reads from Snowflake as a batch source through the standard Snowflake SQL path. The batch connector supports both password authentication and key-pair authentication, with a virtual warehouse driving query execution.
For information on writing into Snowflake, see the Snowflake.
Requirements
Connectivity and credentials must both be in place before the pipeline can run.
Connectivity
The Nilus runtime must reach
<account>.snowflakecomputing.comon TCP443.A running virtual warehouse is required for every read; warehouse size and auto-suspend behavior directly affect ingestion cost and latency.
For key-pair authentication, the public key must already be registered against the Snowflake user (
ALTER USER ... SET RSA_PUBLIC_KEY = '...').
Required parameters
account
Yes
-
Snowflake account identifier (e.g. xy12345.us-west-2.snowflakecomputing.com or xy12345).
username
Yes
-
Snowflake user with access to the warehouse, database, and schema.
password
Conditional
-
Password, required for password authentication. Omit when using key-pair auth.
private_key
Conditional
-
Base64-encoded PEM private key, required for key-pair authentication. Passed as a URI query parameter.
private_key_passphrase
No
-
Passphrase for an encrypted private key, when applicable. The connector decodes the key on the runtime side and re-encodes it for the driver.
database
Yes
-
Default database for the connection.
warehouse
Yes
-
Virtual warehouse to use for all reads.
role
Recommended
account default role
Role for the connection. Strongly recommended to set explicitly so behavior is reproducible across environments.
Database-side permissions
The FUTURE TABLES grant ensures the user keeps SELECT on tables created in the schema after the grant.
URI format
Password authentication:
Key-pair authentication:
Depot-backed equivalent (recommended for production):
Source options
source_table
Yes
Fully qualified table name in <schema>.<table> form. Add an explicit database prefix (<database>.<schema>.<table>) only when reading across databases.
incremental_key
No
Timestamp or numeric column used to identify newly visible rows for each run. Snowflake's LAST_MODIFIED_AT-style columns or sequence-backed id are common picks.
interval_start
No
Optional ISO-8601 lower bound for the extraction window.
interval_end
No
Optional ISO-8601 upper bound for the extraction window.
page_size
No
Rows per extraction batch (default 50000).
sql_reflection_level
No
full (default) or reduced, controls how thoroughly Nilus reflects the source schema before extraction.
sql_limit
No
Caps total rows extracted per run. Use for sampling and validation.
sql_exclude_columns
No
Comma-separated column names to skip during extraction.
type_hints
No
Object map of column_name: <type> to override inferred types. Supported types: text, bigint, bool, timestamp, date, decimal, double, binary, json, time.
max_table_nesting
No
String. "0" for fully flattened analytics-friendly output (default for SQL sources).
Note Snowflake folds unquoted identifiers to upper-case. Quote identifiers in DDL and in
source_tableconsistently, or stick to upper-case in both.
Sample Nilus configs
Each example below is self-contained and uses the current Nilus pipeline shape.
Batch, incremental ingestion to Lakehouse (password auth)
Batch, direct URI with key-pair authentication
Behavior and capabilities
Compute model: Nilus connects to the Snowflake warehouse and submits parameterized SQL reads against the configured warehouse.
Object model: Snowflake databases, schemas, tables, and views, addressed as
<schema>.<table>(or<database>.<schema>.<table>when crossing databases).Pipeline type: this page documents Snowflake batch extraction. Snowflake also supports a metadata pipeline that catalogs the source without copying rows; see Snowflake (Metadata).
Authentication modes: password and key-pair. Key-pair is strongly recommended for production: the connector decodes the supplied PEM, re-encodes the DER form, and hands it to the driver in the format Snowflake expects.
Identifier case: Snowflake stores unquoted identifiers in upper-case. Use upper-case forms in
source_tableto match the catalog, or quote consistently throughout your pipeline.Custom queries: supply
source_table: "query:SELECT ... FROM ..."to extract from a hand-authored SQL query.Lakehouse decimals: table reads preserve source precision and scale (
NUMBER(20,4)becomes Icebergdecimal(20,4)).query:extracts store decimals as Icebergdecimal(38,9). Do not use both extract styles with the samedest_table.Cost control: Snowflake bills per warehouse-second of execution. Lower-cost approaches: keep
incremental_keyenabled so each run scans only fresh data; let the warehouse auto-suspend after each run; consider a dedicated XS or SMALL warehouse for ingestion.
Troubleshooting
390100 Authentication failed (password auth)
Wrong username, wrong password, account locked, or MFA enforced.
Re-check credentials; for accounts with MFA enforced, switch to key-pair auth, which is exempt from interactive MFA.
JWT token is invalid (key-pair auth)
Private key not registered against the user, key passphrase mismatch, or the key is in the wrong PEM format.
Confirm ALTER USER ... SET RSA_PUBLIC_KEY = '...' was run with the matching public key; verify the passphrase; ensure the private key is in PKCS#8 PEM.
No active warehouse selected in the current session
warehouse query parameter omitted, or the role does not have USAGE on the warehouse.
Always set warehouse=<name> in the URI; grant USAGE ON WAREHOUSE <name> TO ROLE <role>.
Object 'X.Y.Z' does not exist or not authorized
Identifier case mismatch (most common: lower-case in manifest, upper-case in catalog), or the role lacks SELECT on the table.
Use the upper-case form in source_table, or quote consistently; grant SELECT to the role.
Run stalls at "warehouse resuming" for several minutes
The warehouse was suspended and is starting from cold; autoresume is enabled but warehouse start is sequential.
Use a dedicated, smaller warehouse for ingestion to keep start time short, or set INITIALLY_SUSPENDED = FALSE for the duration of a backfill.
Run extracts the full table every time despite incremental_key
The column is not monotonically increasing in the source, or the pipeline state was reset between runs.
Pick a column that is genuinely monotonic.
Costs spike during ingestion
Default warehouse is too large, or auto_suspend interval too long, leaving the warehouse running between batches.
Use a small dedicated ingestion warehouse with AUTO_SUSPEND = 60.
ValueError: Cannot serialize value, scale of value does not match type decimal(38, 9): 4
The Lakehouse table was created by a query: extract (decimal(38,9)), then a table read tried to write source-scale decimals such as NUMBER(20,4) — or the reverse.
Keep one extract style per table. Point dest_table at a new table, or drop and reload.
Related docs
Snowflake: companion destination connector.
Snowflake key-pair authentication: recommended password-less authentication setup.
Optimize sink datasets: guidance on
incremental_strategy,partition_by,cluster_by, and other shape settings.Snowflake: catalog Snowflake without copying rows via a
spec.type: metadatapipeline.
Last updated
Was this helpful?