> For the complete documentation index, see [llms.txt](https://docs.warpstream.com/warpstream/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.warpstream.com/warpstream/tableflow/catalogs-and-query-engines/snowflake.md).

# Snowflake

This pages describes how to integrate Tableflow with Snowflake so that you can query Iceberg tables created by WarpStream in Snowflake.

## WarpStream Iceberg Catalog

This guide explains how to query WarpStream Tableflow tables by connecting Snowflake to the WarpStream Iceberg REST catalog.

#### 1. Prepare the Base URL and Authentication

Get the base URL and authentication for the next step by following the instructions in [Iceberg REST Catalog](/warpstream/tableflow/iceberg-catalog.md#construct-the-base-url) and [Iceberg REST Catalog](/warpstream/tableflow/iceberg-catalog.md#authenticate).

#### 2. Create Catalog Integration

```sql
CREATE OR REPLACE CATALOG INTEGRATION warpstream_catalog 
    CATALOG_SOURCE = ICEBERG_REST 
    TABLE_FORMAT = ICEBERG 
    CATALOG_NAMESPACE = 'default' 
    REFRESH_INTERVAL_SECONDS = 60 
    REST_CONFIG = ( 
        CATALOG_URI = '$BASE_URL' 
    ) 
    REST_AUTHENTICATION = ( 
        TYPE = BEARER 
        BEARER_TOKEN = '$AGENT_KEY' 
    )
    ENABLED = TRUE;
```

Replace:

* `$BASE_URL` - Base URL from the previous step.
* `$AGENT_KEY` - Your WarpStream Agent Key (starts with `aks_`) from the previous step.

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2FQ9rvpigWShAnWWwWUasg%2FScreenshot%202025-12-04%20at%2008.48.37.png?alt=media&amp;token=15305e33-b159-4da4-8242-4937afcf46dd" alt=""><figcaption></figcaption></figure>

#### 3. Create External Volume

Configure an external volume `<warpstream_volume>` pointing to your Tableflow storage bucket by following these instructions: <https://docs.snowflake.com/en/user-guide/tables-iceberg-configure-external-volume>

Basically, you will need to configure the correct authentication or privileges (IAM role, GCS principal etc.) depending on the storage provider, and then run this command to create an external volume:

```sql
CREATE OR REPLACE EXTERNAL VOLUME <warpstream_volume> 
    STORAGE_LOCATIONS = ( 
        ( 
            NAME = '<warpstream_volume>', 
            STORAGE_PROVIDER = '<storage_provider>', 
            STORAGE_BASE_URL = '<bucket_url>' 
        ) 
    );
```

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2FdwpWQxWOqayCssYdMRNw%2FScreenshot%202025-12-04%20at%2008.49.14.png?alt=media&amp;token=afdbc2f2-afb2-4ffe-9dc7-dd9a9ce0590a" alt=""><figcaption></figcaption></figure>

#### 4. Create Iceberg Table

```sql
CREATE OR REPLACE ICEBERG TABLE my_table
    EXTERNAL_VOLUME = '<warpstream_volume>' 
    CATALOG = 'warpstream_catalog' 
    CATALOG_TABLE_NAME = '<table_name>';
```

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2FFAZwEN3CchNxYIG5IYl4%2FScreenshot%202025-12-04%20at%2010.45.10.png?alt=media&amp;token=b497de11-730d-4e98-86d8-faa2aceba3f4" alt=""><figcaption></figcaption></figure>

#### 5. Query the Table

```sql
-- Count records 
SELECT COUNT(*) FROM my_table;
-- View sample data 
SELECT * FROM my_table LIMIT 10;
```

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2FI9xqgKDqcidBrKvvsaRS%2FScreenshot%202025-12-04%20at%2010.46.01.png?alt=media&amp;token=3573de7b-73a7-49cd-bde6-4f5252a3f6d2" alt=""><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.warpstream.com/warpstream/tableflow/catalogs-and-query-engines/snowflake.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
