You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/snowflake/features/dynamic-tables.md
+121Lines changed: 121 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,3 +88,124 @@ The output should be:
88
88
| 2 | bar |
89
89
+----+------+
90
90
```
91
+
92
+
## Dynamic Iceberg Tables
93
+
94
+
Dynamic Iceberg Tables combine the auto-refresh capabilities of Dynamic Tables with the Apache Iceberg open table format. This allows you to create materialized views that automatically update from source queries while storing data in Iceberg format on external object storage (such as S3).
95
+
96
+
A Dynamic Iceberg Table consists of three key concepts:
97
+
-**Dynamic table**: A materialized view that auto-refreshes from a source query on a schedule (controlled by `TARGET_LAG` and `WAREHOUSE`).
98
+
-**Iceberg table**: A table stored in Apache Iceberg format on external object storage (configured via `EXTERNAL_VOLUME`, `CATALOG`, and `BASE_LOCATION`).
99
+
-**External volume**: A Snowflake object that references an S3 bucket as the backing storage for Iceberg data files.
100
+
101
+
### Create an S3 bucket
102
+
103
+
Create a local S3 bucket using the `mb` command with the `awslocal` CLI:
104
+
105
+
```bash
106
+
awslocal s3 mb s3://test-bucket
107
+
```
108
+
109
+
### Create an external volume
110
+
111
+
Create an external volume to define the storage location for the Iceberg data files:
You can query the Dynamic Iceberg Table using a standard `SELECT` statement:
163
+
164
+
```sql
165
+
SELECT*FROM my_dynamic_iceberg_table ORDER BY id;
166
+
```
167
+
168
+
The output should be:
169
+
170
+
```sql
171
+
+----+------+
172
+
| ID | NAME |
173
+
|----+------+
174
+
| 1 | foo |
175
+
| 2 | bar |
176
+
+----+------+
177
+
```
178
+
179
+
### Show Dynamic Tables
180
+
181
+
You can view the metadata of your Dynamic Iceberg Table using the `SHOW DYNAMIC TABLES` command. The `is_iceberg` column indicates whether the table is a Dynamic Iceberg Table:
182
+
183
+
```sql
184
+
SHOW DYNAMIC TABLES LIKE'my_dynamic_iceberg_table';
185
+
```
186
+
187
+
### Rename a Dynamic Iceberg Table
188
+
189
+
You can rename a Dynamic Iceberg Table using the `ALTER DYNAMIC TABLE` statement:
190
+
191
+
```sql
192
+
ALTER DYNAMIC TABLE my_dynamic_iceberg_table RENAME TO my_renamed_table;
193
+
```
194
+
195
+
### Drop a Dynamic Iceberg Table
196
+
197
+
You can drop a Dynamic Iceberg Table using the `DROP DYNAMIC TABLE` statement:
0 commit comments