TD_SNAPSHOTS() Function - Teradata Vantage

Apache Iceberg and Delta Lake Open Table Format on VantageCloud Lake Getting Started

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
December 2024
ft:locale
en-US
ft:lastEdition
2025-01-03
dita:mapPath
bsr1702324250454.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
bsr1702324250454

Returns Snapshot information for an Iceberg or Delta Lake table.

Syntax

[TD_SYSFNLIB.]TD_SNAPSHOTS( ON ( <datalake_name>.<database_name>.<table_name> ) ) <alias_name>;

Example: Iceberg

Columns Returned

  • snapshotId
  • snapshotTimestamp
  • timestampMSecs
  • manifestList
  • summary
SELECT * FROM TD_SNAPSHOTS(ON (datalake_iceberg_glue.vim.cdata)) D;
 *** Query completed. 2 rows found. 5 columns returned. 
 *** Total elapsed time was 10 seconds.
       snapshotId  6373759902296319074
 snapshotTimestamp 2023-06-15 00:07:47
   timestampMSecs  686787667420
     
      manifestList  s3://vim-iceberg-v1/glue/metadata/snap-6373759902296319074-1-28a1d854-5be4-45c2-92fe-66f0dc75e7bc.avro
          summary  {"added-data-files":"1","added-records":"5","added-files-size":"2028","changed-partition-count":"1","total-records":"5","total-files-size":"2028","total-data-files":"1","total-delete-files":"0","total-position-deletes":"0","total-eq
       snapshotId  4768076782814510171
snapshotTimestamp  2023-06-15 00:09:01
   timestampMSecs  1686787741964
     manifestList  s3://vim-iceberg-v1/glue/metadata/snap-4768076782814510171-1-85485f8a-ebb4-4595-9a3e-42f314dafbe1.avro
          summary  {"added-data-files":"1","added-records":"2","added-files-size":"1924","changed-partition-count":"1","total-records":"7","total-files-size":"3952","total-data-files":"2","total-delete-files":"0","total-position-deletes":"0","total-eq

Example: Delta Lake

Columns Returned

  • snapshotVersion
  • lastCommitTimestamp
  • lastCommitTimestampMSecs
  • metadata
  • logPath
  • summary
SELECT * FROM TD_SNAPSHOTS(ON (deltalake_glue.db1.table1)) dt1;
 *** Query completed. 2 rows found. 6 columns returned.
 *** Total elapsed time was 2 seconds.
         snapshotVersion                    0
     lastCommitTimestamp 2024-03-11 17:32:19
lastCommitTimestampMSecs        1710178339000
                metadata {"metadataId":"32a23cf8-50bd-44ef-9c0b-0e31d361eea
                 logPath s3://delta-v1/data/users/_delta_log
                 summary {"fileCount":1,"filesSizeInBytes":3255}
         snapshotVersion                    1
     lastCommitTimestamp 2024-03-11 17:41:21
lastCommitTimestampMSecs        1710178881000
                metadata {"metadataId":"32a23cf8-50bd-44ef-9c0b-0e31d361eea
                 logPath s3://delta-v1/data/users/_delta_log
                 summary {"fileCount":2,"filesSizeInBytes":7360}