> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Cognite Data Fusion (CDF) is an industrial DataOps platform. Prefer English docs unless the user asks for another locale.
> Follow /_llms/ index links recursively until you reach page URLs ending in .md. Fetch those Markdown twins instead of HTML.
> For REST APIs, default to calendar version 20230101 (stable). Use 20230101-beta or 20230101-alpha only if the user is on a preview API. Cite paths under /api-reference/concepts/<version>/ and the Cdf-Version header. Prefer the Python SDK (cognite-sdk) unless the user is in JavaScript/TypeScript.
> Start here by task: platform overview /cdf/index.md; data modeling /cdf/dm/index.md; data integration /cdf/integration/index.md; access /cdf/access/index.md; CDF Toolkit /cdf/deploy/cdf_toolkit/index.md; REST quickstart /dev/quickstart.md; Python SDK https://cognite-sdk-python.readthedocs-hosted.com/en/stable/; Atlas AI /cdf/atlas_ai/index.md; plan an Atlas AI agent /cdf/atlas_ai/concepts/atlas_ai_agent_planning.md; Flows apps /cdf/flows/index.md; MCP and IDE setup /dev/guides/ide_ai_integration.md.
> For implementation work, also load /skill.md.

# About Snowflake in Transformations

> Learn about Snowflake in Transformations and how queries read tables without a full copy in CDF RAW.

> [!WARNING]
>
> The features described in this article are in [public preview](https://docs.cognite.com/cdf/product_feature_status.md#public-preview) and may change.

[Transformations](https://docs.cognite.com/cdf/integration/concepts/transformation.md) in Cognite Data Fusion (CDF) can query Snowflake tables without staging a full copy in CDF RAW. You register an [external data source](https://docs.cognite.com/api-reference/concepts/20230101-beta/transformation-external-data.md), then read it in SQL with `ext_snowflake`. Transformation results are still written to CDF destinations such as data models.

Snowflake remains the system of record for the source tables. Each run reads the current table state on your Snowflake warehouse. CDF generates an RSA key pair, stores the private key encrypted, and returns only the public key.

## What this path does

| Aspect | Behavior |
| - | - |
| No RAW staging copy | Jobs read Snowflake tables at query time. Data is not bulk-loaded into RAW only to enable the pipeline. |
| Query-time access | Each run reads the current table state. |
| Credentials in CDF | CDF generates an RSA key pair, stores the private key encrypted, and returns only the public key. |
| Read-only from Snowflake | Transformations do not write back to Snowflake. |
| Output in CDF | Modeled results still land in CDF destinations. |

## How it works

1. Register a Snowflake integration as an **external data source**. CDF returns a public key.
2. Send that public key to your Snowflake admin. The admin registers it on the Snowflake service user.
3. Reference a table in transformation SQL with `ext_snowflake(...)`.
4. Shape the data with Spark SQL.
5. Write the result to a CDF destination such as a data model.

You register the external data source in Integrations, or with the Transformations API. Runtime stays in Transformations.

## Requirements

* A Snowflake **service user** and **service role** with `USAGE` on the database, schema, and warehouse, and `SELECT` on the tables. Standard tables, dynamic tables, and Snowflake-managed Iceberg tables are supported.
* A warehouse that runs the reads.
* Network access from CDF to the Snowflake account. If the account uses a network policy, contact [Cognite Support](https://cognite.zendesk.com/hc/en-us/requests/new) for the CDF egress IP addresses. Your Snowflake admin allowlists those addresses so CDF can reach the account.
* [CDF capabilities](https://docs.cognite.com/cdf/access/guides/capabilities.md#transform-data) for external data sources and Transformations.

## Incremental loading with is\_new

Use `is_new()` so Transformations process only new or changed rows. Your Snowflake table must include a `TIMESTAMP` or epoch-millisecond `LONG` column that your pipeline updates when a row changes. Snowflake does not maintain this column. Without it, each run reads the full table.

An incremental read does not pick up deleted rows. See [Known limitations](#known-limitations).

For syntax and examples, see [Read Snowflake data](https://docs.cognite.com/cdf/integration/guides/transformation/read_snowflake.md#incremental-loads-with-is_new).

## Known limitations

### Deleted rows are not removed

Rows deleted in Snowflake do not appear in an incremental read, and CDF does not remove the matching instances.

For a way to reflect deletes, see [Deleted rows stay in CDF](https://docs.cognite.com/cdf/integration/guides/transformation/troubleshoot_snowflake.md#deleted-rows-stay-in-cdf).

### Write-back is not supported

`ext_snowflake` is read-only. Write-back is not supported.

### Iceberg files are read in Snowflake

This connection reads Snowflake tables, including Snowflake-managed Iceberg tables. CDF does not read the Iceberg files directly. Snowflake reads the files, and CDF receives the query results.

### A RAW destination adds a staging copy

Prefer a data model destination. Writing the result to RAW adds the staging copy this path is meant to skip.

## Next steps

> [card] [Set up an external data source](https://docs.cognite.com/cdf/integration/guides/transformation/set_up_snowflake_connection.md)
>
> Register the Snowflake connection in Integrations or with the API. Your Snowflake admin registers the public key.

> [card] [Read Snowflake data](https://docs.cognite.com/cdf/integration/guides/transformation/read_snowflake.md)
>
> Query with `ext_snowflake` and write to a CDF destination.

For API schemas, see [Transformation external data sources](https://docs.cognite.com/api-reference/concepts/20230101-beta/transformation-external-data.md) and the [beta OpenAPI tag](https://api-docs.cognite.com/20230101-beta/tag/Transformation-External-Data-Sources).

To ingest Snowflake data with the Cognite DB extractor, see [Ingest data from Snowflake with OAuth](https://docs.cognite.com/cdf/integration/guides/extraction/db/db_snowflake_oauth_setup.md).
