GET_TABLE_VERSION_REFS

functionnot supportedTables, views, streams, sequencespreview

docs.snowflake.com ↗

Table functions

Returns one row for each tag or branch in the Iceberg table metadata that Snowflake has indexed, when the snapshot that the reference points to is present in that metadata. Each row includes the target snapshot and the reference’s retention settings. To query the snapshot that a reference points to, pass the reference name to the AT clause. For more information, see Time Travel for Apache Iceberg™ tables.

Syntax

GET_TABLE_VERSION_REFS(
  '<table_name>'
)

Parameters

NameRequiredDescription
'table_name'requiredThe name of the Iceberg table whose references 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 REFERENCE_NAME | TEXT | The name of the tag or branch. REFERENCE_TYPE | TEXT | TAG or BRANCH. VERSION_ID | NUMBER | The Iceberg snapshot ID that the reference points to. VERSION_CREATED_AT | TEXT | The time when that snapshot was committed. MAX_REFERENCE_AGE_IN_MS | NUMBER | How long the reference is retained, in milliseconds. For a tag, this value comes from the RETAIN clause. NULL if the reference has no retention period. MIN_SNAPSHOTS_TO_KEEP | NUMBER | The minimum number of snapshots retained on a branch. Always NULL for tags. MAX_SNAPSHOT_AGE_IN_MS | NUMBER | How long snapshots are retained on a branch, in milliseconds. Always NULL for tags.