GET_TABLE_VERSIONS

functionnot supportedTables, views, streams, sequencespreview

docs.snowflake.com ↗

Table functions

Returns 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

NameRequiredDescription
'table_name'requiredThe 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

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 =&gt; ...) 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.