|
1 |
| -# Snowflake integration |
2 |
| - |
3 | 1 | Integrate {{< product-name >}} with Snowflake without complex ETL processes.
|
4 | 2 | Export time series data snapshots into Apache Iceberg format and query directly from Snowflake.
|
5 | 3 |
|
6 |
| -> **Note**: Contact [InfluxData sales](https://www.influxdata.com/contact-sales/) to enable this capability for your organization. |
7 |
| -
|
8 | 4 | ## Key benefits
|
9 | 5 |
|
10 | 6 | - **Efficient data access**: Query your data directly from Snowflake.
|
11 | 7 | - **Cost-effective storage**: Optimize data retention and minimize storage costs.
|
12 | 8 | - **Supports AI and ML workloads**: Enhance machine learning applications by making time-series data accessible in Snowflake.
|
13 | 9 |
|
14 |
| -## Prerequisites |
| 10 | +> [!Note] |
| 11 | +> #### Contact sales to enable the InfluxDB Iceberg integration |
| 12 | +> |
| 13 | +> The InfluxDB Iceberg integration is a premium feature. |
| 14 | +> [Contact InfluxData Sales](https://www.influxdata.com/contact-sales/) to enable this capability for your account. |
| 15 | +
|
| 16 | +- [Prerequisite](#prerequisite) |
| 17 | +- [Request Iceberg integration](#request-iceberg-integration) |
| 18 | +- [Integrate InfluxDB 3 with Snowflake](#integrate-influxdb-3-with-snowflake) |
| 19 | +- [Export data to Iceberg format](#export-data-to-iceberg-format) |
| 20 | +- [Check snapshot status](#check-snapshot-status) |
| 21 | +- [Query the Iceberg table from Snowflake](#query-the-iceberg-table-from-snowflake) |
| 22 | +- [Considerations and limitations](#considerations-and-limitations) |
15 | 23 |
|
16 |
| -Before you begin, ensure you have the following: |
| 24 | +### Prerequisite |
17 | 25 |
|
18 |
| -- **{{< product-name >}} Cloud Dedicated plan** or compatible environment |
| 26 | +Before you begin, ensure you have an [{{< product-name >}} account](/influxdb3/cloud-dedicated/get-started/setup/). |
19 | 27 |
|
20 |
| -## Request Iceberg integration |
| 28 | +### Request Iceberg integration |
21 | 29 |
|
22 |
| -1. Contact [InfluxData sales](https://www.influxdata.com/contact-sales/) to request Iceberg integration. |
| 30 | +1. [Contact InfluxData Sales](https://www.influxdata.com/contact-sales/) to request Iceberg integration for your {{% product-name %}} cluster. |
23 | 31 |
|
24 |
| -2. Be prepared to provide: |
| 32 | +2. Be prepared to provide the following information: |
25 | 33 | - Your organization ID
|
26 | 34 | - Customer name
|
27 | 35 | - Cloud provider and region
|
28 | 36 | - External storage details (bucket name, region, permissions)
|
29 | 37 | - Technical contact information
|
30 | 38 |
|
31 |
| -> **Note**: Iceberg integration is a premium feature that requires setup by the InfluxData team. |
32 |
| -
|
33 |
| -## Integrate InfluxDB 3 with Snowflake |
34 |
| - |
35 |
| -Once you've contacted sales and enabled Iceberg integration, your InfluxData support engineers will help you with the following steps: |
36 |
| - |
37 |
| -1. [Create a Snowflake external stage](#create-a-snowflake-external-stage) |
38 |
| -2. [Export InfluxDB time series data to Iceberg format](#export-influxdb-time-series-data-to-iceberg-format) |
39 |
| -3. [Create an Iceberg table in Snowflake](#create-an-iceberg-table-in-snowflake) |
40 |
| -4. [Query the Iceberg table from Snowflake](#query-the-iceberg-table-from-snowflake) |
41 |
| - |
42 |
| -### Create a Snowflake external stage |
43 |
| - |
44 |
| -Your support engineer will guide you through setting up a Snowflake external stage using the `CREATE STAGE` Snowflake SQL command. This establishes an external storage location (such as AWS S3) to store Iceberg table data and metadata. |
45 |
| - |
46 |
| -#### Example: Configure an S3 stage in Snowflake |
47 |
| - |
48 |
| -```sql |
49 |
| -CREATE STAGE my_s3_stage |
50 |
| -URL='s3://my-bucket/' |
51 |
| -STORAGE_INTEGRATION=my_storage_integration; |
52 |
| -``` |
| 39 | +### Setup Snowflake and configure your cluster |
53 | 40 |
|
54 |
| -### Set up a catalog integration in Snowflake |
| 41 | +The {{% product-name %}} Iceberg integration requires setup by the InfluxData team. |
| 42 | +After you have contacted sales and enabled Iceberg integration, you'll specify which |
| 43 | +tables you want to make available for exporting. |
| 44 | +InfluxData support engineers will help you with the integration steps, which include: |
55 | 45 |
|
56 |
| -Your support engineer will help you set up a catalog integration in Snowflake to manage and load Iceberg tables efficiently. |
| 46 | +- Setting up a Snowflake external stage using the `CREATE STAGE` Snowflake SQL command and your storage provider details. |
| 47 | +This establishes an external storage location (such as AWS S3) to store Iceberg table data and metadata. |
| 48 | +- Setting up a catalog integration in Snowflake to manage and load Iceberg tables efficiently. |
| 49 | +For more information, refer to the [Snowflake documentation](https://docs.snowflake.com/en/user-guide/tables-iceberg-configure-catalog-integration). |
| 50 | +- Creating an export configuration that tells the InfluxDB Iceberg exporter which tables are available for export. |
57 | 51 |
|
58 |
| -#### Example: Create a catalog integration in Snowflake |
| 52 | +After the setup is complete, you can export data snapshots to Iceberg format and query the Iceberg table from Snowflake. |
59 | 53 |
|
60 |
| -```sql |
61 |
| -CREATE CATALOG INTEGRATION my_catalog_integration |
62 |
| - CATALOG_SOURCE = 'OBJECT_STORE' |
63 |
| - TABLE_FORMAT = 'ICEBERG' |
64 |
| - ENABLED = TRUE; |
65 |
| -``` |
| 54 | +> [!Important] |
| 55 | +> #### Export tables are read-only in Snowflake |
| 56 | +> |
| 57 | +> Tables created through this integration are _read-only_. |
| 58 | +> You cannot write directly to these tables using Snowflake or any other engine. |
| 59 | +> |
66 | 60 |
|
67 |
| -For more information, refer to the [Snowflake documentation](https://docs.snowflake.com/en/user-guide/tables-iceberg-configure-catalog-integration). |
| 61 | +## Export data to Iceberg format |
68 | 62 |
|
69 |
| -### Export InfluxDB time series data to Iceberg format |
| 63 | +Use the `influxctl` CLI or the HTTP API to export snapshots to Iceberg format. |
70 | 64 |
|
71 |
| -> **Note**: Before exporting InfluxDB time series data to Iceberg format, ensure that the relevant InfluxDB tables are properly set up. Please reach out to your support engineers to configure the tables that need to be exported. |
| 65 | +> [!Important] |
| 66 | +> Before you can export data to Iceberg format, the InfluxData Support Team needs |
| 67 | +> to set up your tables for exporting. |
| 68 | +> For more information, [contact the InfluxData Sales team]({{< cta-link >}}). |
72 | 69 |
|
73 | 70 | {{< tabs-wrapper >}}
|
74 | 71 | {{% tabs %}}
|
75 |
| -[CLI](#tab-cli) |
76 |
| -[API](#tab-api) |
| 72 | +[CLI](#cli) |
| 73 | +[API](#api) |
77 | 74 | {{% /tabs %}}
|
78 |
| - |
79 | 75 | {{% tab-content %}}
|
80 |
| -{{% tab-pane id="tab-cli" %}} |
81 |
| -#### Using the CLI |
82 | 76 |
|
83 |
| -Use the `influxctl` command to export InfluxDB time-series data to Iceberg format: |
84 |
| - |
85 |
| -```sh |
86 |
| -influxctl snapshot export --namespace foo --table bar |
| 77 | +{{% code-placeholders "NAMESPACE|TABLE_NAME" %}} |
| 78 | +```bash |
| 79 | +influxctl snapshot export --namespace NAMESPACE --table TABLE_NAME |
87 | 80 | ```
|
88 |
| -{{% /tab-pane %}} |
89 |
| -{{% tab-pane id="tab-api" %}} |
90 |
| -#### Using the API |
91 |
| - |
92 |
| -Use the {{% product-name %}} HTTP API to export snapshots and check status. |
| 81 | +{{% /code-placeholders %}} |
93 | 82 |
|
94 |
| -##### Example: Export a snapshot |
| 83 | +Replace the following: |
95 | 84 |
|
96 |
| -This example demonstrates how to export a snapshot of your data from InfluxDB to an Iceberg table using the HTTP API. |
| 85 | +- {{% code-placeholder-key %}}`NAMESPACE`{{% /code-placeholder-key %}}: The namespace of the data to export. <!-- Namespace might need more explanation --> |
| 86 | +- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: The table name to export |
97 | 87 |
|
98 |
| -- **Method**: `POST` |
99 |
| -- **Endpoint**: `/snapshots/export` |
100 |
| -- **Request body**: |
101 |
| - |
102 |
| -```json |
103 |
| -{ |
104 |
| - "namespace": "foo", |
105 |
| - "table": "bar" |
106 |
| -} |
107 |
| -``` |
108 |
| -The `POST` request to the `/snapshots/export` endpoint triggers the export of data from the specified namespace and table in InfluxDB to an Iceberg table. The request body specifies the namespace (`foo`) and the table (`bar`) to be exported. |
109 |
| - |
110 |
| -##### Example: Check snapshot status |
111 |
| - |
112 |
| -This example shows how to check the status of an ongoing or completed snapshot export using the HTTP API. |
113 |
| - |
114 |
| -- **Method**: `GET` |
115 |
| -- **Endpoint**: `/snapshots/status` |
116 |
| - |
117 |
| -The `GET` request to the `/snapshots/status` endpoint retrieves the status of the snapshot export. This can be used to monitor the progress of the export or verify its completion. |
118 |
| -{{% /tab-pane %}} |
119 | 88 | {{% /tab-content %}}
|
120 |
| -{{< /tabs-wrapper >}} |
121 |
| - |
122 |
| -#### Creating a configuration file |
| 89 | +{{% tab-content %}} |
123 | 90 |
|
124 |
| -Before running the export command, you need to create a configuration file that specifies which tables to export: |
| 91 | +**Endpoint**: |
125 | 92 |
|
126 |
| -1. Create a file named `config.json` in your working directory |
127 |
| -2. Add the following JSON content, adjusting the namespace and table names to match your data: |
| 93 | +{{% api-endpoint method="POST" endpoint="/snapshots/export" %}} |
128 | 94 |
|
| 95 | +**Request body**: |
| 96 | + |
129 | 97 | ```json
|
130 | 98 | {
|
131 |
| - "exports": [ |
132 |
| - { |
133 |
| - "namespace": "company_sensors", |
134 |
| - "table_name": "cpu" |
135 |
| - } |
136 |
| - ] |
| 99 | + "namespace": "NAMESPACE", |
| 100 | + "table": "TABLE_NAME" |
137 | 101 | }
|
138 | 102 | ```
|
139 | 103 |
|
140 |
| -This configuration file tells the exporter which InfluxDB tables to convert to Iceberg format. You can list multiple tables by adding more objects to the exports array. |
| 104 | +The following example shows how to use cURL with the HTTP API: |
141 | 105 |
|
142 |
| -After configuring the export settings in the `config.json` file, the system automatically handles the export process. The export generates an Iceberg metadata file that you'll reference when creating your Iceberg table in Snowflake. |
| 106 | +{{% code-placeholders "NAMESPACE|TABLE_NAME" %}} |
| 107 | +```bash |
| 108 | +curl -X POST https://{{% influxdb/host %}}/snapshots/export \ |
| 109 | + -d '{"namespace": "NAMESPACE", "table": "TABLE_NAME"}' |
| 110 | +``` |
| 111 | +{{% /code-placeholders %}} |
143 | 112 |
|
144 |
| -### Create an Iceberg table in Snowflake |
| 113 | +Replace the following: |
145 | 114 |
|
146 |
| -After the export process is complete, you can work with your InfluxData support engineer to create an Iceberg table in Snowflake that references your exported data. If you do not have access to a support engineer, refer to the Snowflake documentation or consult your database administrator for assistance. Here's what happens during this step: |
| 115 | +- {{% code-placeholder-key %}}`NAMESPACE`{{% /code-placeholder-key %}}: The namespace of the data to export. <!--Might need more explanation--> |
| 116 | +- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: The table name to export |
147 | 117 |
|
148 |
| -After the export process is complete, you'll work with your InfluxData support engineer to create an Iceberg table in Snowflake that references your exported data. Here's what happens during this step: |
| 118 | +{{% /tab-content %}} |
| 119 | +{{< /tabs-wrapper >}} |
149 | 120 |
|
150 |
| -> **Note**: **Tables created through this integration are read-only.** |
151 |
| -> **You cannot write directly to these tables using Snowflake or any other engine.** |
152 |
| -> They serve as an analytics interface to your InfluxDB data. |
| 121 | +## Check snapshot status |
153 | 122 |
|
154 |
| -1. Your support engineer will provide you with the location of the Iceberg metadata file generated during the export process. |
| 123 | +Use the HTTP API to check the status of an ongoing or completed snapshot export. |
155 | 124 |
|
156 |
| -2. Using this information, you or your database administrator will execute a SQL command in Snowflake similar to: |
| 125 | +{{% api-endpoint method="GET" endpoint="/snapshots/status" %}} |
157 | 126 |
|
158 |
| -```sql |
159 |
| -CREATE ICEBERG TABLE my_iceberg_table |
160 |
| - EXTERNAL_VOLUME = 'my_external_volume' |
161 |
| - METADATA_FILE_PATH = 's3://my-bucket/path/to/metadata.json'; |
| 127 | +```bash |
| 128 | +curl -X GET https://{{% influxdb/host %}}/snapshots/status |
162 | 129 | ```
|
163 | 130 |
|
164 |
| -3. Your support engineer will help ensure the EXTERNAL_VOLUME and METADATA_FILE_PATH parameters correctly point to your external storage and metadata file. |
165 |
| - |
166 |
| -This creates a table in Snowflake that reads directly from the Iceberg-formatted data exported from your InfluxDB instance. |
167 |
| - |
168 |
| -### Query the Iceberg table from Snowflake |
| 131 | +## Query the Iceberg table from Snowflake |
169 | 132 |
|
170 |
| -Once the Iceberg table is set up, you can query it using standard SQL in Snowflake. |
171 |
| - |
172 |
| -#### Example: Query the Iceberg table |
173 |
| - |
174 |
| -```sql |
175 |
| -SELECT * FROM my_iceberg_table |
176 |
| -WHERE timestamp > '2025-01-01'; |
177 |
| -``` |
| 133 | +Use SQL in Snowflake to query the Iceberg table exported from {{< product-name >}}. |
178 | 134 |
|
179 | 135 | ## Considerations and limitations
|
180 | 136 |
|
181 | 137 | When exporting data from InfluxDB to an Iceberg table, keep the following considerations and limitations in mind:
|
182 | 138 |
|
| 139 | +- **Exported data is read-only**: Tables created through this integration are _read-only_. You cannot write directly to these tables using Snowflake or any other engine. |
183 | 140 | - **Data consistency**: Ensure that the exported data in the Iceberg table is consistent with the source data in InfluxDB.
|
184 | 141 | - **Performance**: Query performance may vary based on data size and query complexity.
|
185 | 142 | - **Feature support**: Some advanced features of InfluxDB may not be fully supported in Snowflake through Iceberg integration.
|
| 143 | + |
0 commit comments