GET_TABLE_VERSIONS
functionnot supportedTables, views, streams, sequencespreviewReturns one row for each data snapshot that Snowflake has indexed for an Apache Iceberg™ table. Use this function to find the snapshot that you want to query, or to create a version tag on. To query a snapshot, pass its snapshot ID to the AT clause. For more information, see Time Travel for Apache Iceberg™ tables.
Syntax
GET_TABLE_VERSIONS(
'<table_name>'
)
Parameters
| Name | Required | Description |
|---|---|---|
'table_name' | required | The name of the Iceberg table whose version history you want to retrieve. The table name is a string, so it must be enclosed in single quotes. If the table name is fully qualified, such as '<db>.<schema>.<table_name>', enclose the entire name in single quotes. |
Usage notes
- The argument must be a literal string. You can’t pass a column or an expression.
- The output contains only data-changing snapshots that Snowflake still has indexed. Snapshots that have left the retained history don’t appear. Operations that update table metadata without writing data, such as adding a column or creating a version tag, don’t produce a snapshot and don’t appear in the output.
Output
The function returns the following columns: Column name | Data type | Description VERSION_ID | NUMBER | The Iceberg snapshot ID. Pass this value to AT(VERSION => ...) to query the snapshot. VERSION_CREATED_AT | TEXT | The time when the snapshot was committed. QUERY_ID | TEXT | The ID of the query that produced the snapshot. For tables that use automated refresh, this column is a string of zeros.