> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/concepts/resources/nilus/destinations/cloud-warehouses/snowflake.md).

# Snowflake

[Snowflake](https://docs.snowflake.com/) is a cloud data platform for structured and semi-structured analytics workloads. Nilus writes into Snowflake tables for both batch and CDC pipelines, supporting password and key-pair authentication.

## Requirements

Connectivity and credentials must both be in place before the pipeline can run.

### Connectivity

* The Nilus runtime must reach the Snowflake account hostname (typically `<account>.snowflakecomputing.com`) on TCP `443`.
* The configured Snowflake user has to be tied to a non-suspended **warehouse**, and that warehouse is what executes the write workload.
* For private-link or VPC-isolated Snowflake accounts, verify the runtime egress can resolve and reach the private endpoint.

### Required parameters

| Parameter   | Required    | Default         | Description                                                                                         |
| ----------- | ----------- | --------------- | --------------------------------------------------------------------------------------------------- |
| `account`   | Yes         | -               | Snowflake account identifier, for example `xy12345.us-east-1`.                                      |
| `database`  | Yes         | -               | Target database.                                                                                    |
| `warehouse` | Yes         | -               | Warehouse used for writes. Snowflake will reject all DML if this is missing.                        |
| `username`  | Yes         | -               | Snowflake login user.                                                                               |
| `password`  | Conditional | -               | Required for password authentication. Omit when using key-pair authentication.                      |
| `role`      | No          | account default | Optional session role.                                                                              |
| `auth_mode` | No          | `password`      | Set to `key-pair` (or use a Depot configured for key-pair) to switch to private-key authentication. |

> **Tip** For production deployments, prefer key-pair authentication over password auth.

### Permissions

The Snowflake role used by the pipeline needs:

* `USAGE` on the target warehouse, database, and schema.
* `CREATE TABLE` on the target schema if Nilus is expected to auto-create the destination.
* `INSERT`, `UPDATE`, `DELETE` on the target tables according to the configured `incremental_strategy`.
* For `merge`, the destination table must have a stable primary key; configure it in the manifest so Snowflake can reconcile rows.

### URI format

```
snowflake://<username>:<password>@<account>/<database>?warehouse=<warehouse>&role=<role>
```

For Depot-backed configurations, the connection target (`warehouse`, `account`, `database`) lives in the Depot spec, and the credentials (`username`, the optional `role`, and the password or key-pair material) live in the referenced secret; the manifest only references `dataos://<snowflake-depot>?purpose=rw`.

## Sink options

| Option                 | Required | Description                                                                                                                       |
| ---------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `dest_table`           | Yes      | Target table in `<schema>.<table>` form.                                                                                          |
| `incremental_strategy` | Yes      | One of `replace`, `append`, or `merge`. See the [Destinations](/concepts/resources/nilus/destinations.md) overview for semantics. |

## Sample Nilus configs

Each example below is self-contained and uses the current Nilus pipeline shape.

### Batch ingestion

```yaml
name: nilus-snowflake-batch
version: v1alpha
type: nilus
spec:
  type: batch
  compute: universe-compute
  source:
    address: dataos://salesforce-source
    options:
      source_table: account
  sink:
    address: dataos://snowflake-destination
    options:
      dest_table: analytics.account_snapshot
      incremental_strategy: replace
```

### CDC ingestion

```yaml
name: nilus-snowflake-cdc
version: v1alpha
type: nilus
spec:
  type: cdc
  compute: universe-compute
  source:
    address: dataos://mssql-cdc-depot
    cdc:
      table.include.list: "dbo.customers"
      topic.prefix: "customers_cdc"
  sink:
    address: dataos://snowflake-destination
    options:
      dest_table: analytics.customers_cdc
      incremental_strategy: merge
```

## Behavior and capabilities

* **Compute model**: the configured Snowflake warehouse executes the write workload; the Nilus runtime is a SQL client.
* **Object model**: standard Snowflake tables addressed as `<schema>.<table>`.
* **Supported pipeline modes**: `batch` and `cdc`.
* **Auth modes**: password (default) and key-pair. For key-pair, keep the private key inside the secret layer and reference it via the Depot.
* **Identifier case**: Snowflake folds unquoted identifiers to upper-case. Either keep `dest_table` upper-case, or quote identifiers in the destination DDL when you need mixed case.

## Troubleshooting

| Symptom                                               | Likely cause                                                                                               | Resolution                                                                                                                             |
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `390100: Authentication failed`                       | Wrong username/password, wrong account identifier, or expired key-pair.                                    | Verify the account string (region-suffixed form), login details, and active authentication mode; rotate the key if it has expired.     |
| `No active warehouse selected in the current session` | The connection does not specify a warehouse, or the warehouse the user defaults to is suspended.           | Add `warehouse=<wh>` to the URI / Depot spec and confirm the warehouse is `STARTED`.                                                   |
| `SQL access control error: Insufficient privileges`   | The active role lacks `USAGE` / `CREATE TABLE` / DML on the target schema.                                 | Grant the missing privileges, or `USE ROLE` a role that already has them, on the destination schema.                                   |
| Identifier mismatch (`Object … does not exist`)       | `dest_table` was supplied with mixed case but the table was created with the upper-case Snowflake default. | Either match the upper-case form (`ANALYTICS.ORDERS`) or quote identifiers in the destination DDL so they round-trip case-sensitively. |
| `merge` runs duplicate rows over time                 | Manifest is missing a stable primary key; Snowflake cannot reconcile.                                      | Add a `primary_key` to the manifest's dataset spec and rerun.                                                                          |

## Related docs

* [Snowflake](/concepts/resources/nilus/batch/batch-sources/snowflake.md): companion batch source connector.
* [Optimize Sink Datasets](/concepts/resources/nilus/pipeline-optimization/optimize-sink-datasets.md): guidance on `incremental_strategy`, `partition_by`, `cluster_by`, and other dataset-shape settings for Snowflake sinks.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://v2.dataos.info/concepts/resources/nilus/destinations/cloud-warehouses/snowflake.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
