TD_HISTORY() 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

TD_HISTORY() table operator returns the snapshot history related to a datalake table.

Columns Returned

  • id
  • timestamp

Syntax

TD_SYSFNLIB.TD_HISTORY( ON ( <datalake_name>.<database_name>.<table_name> ) ) <alias_name>
  <datalake_name>::= Name of DATALAKE object
  <database_name>:: Name of database in data lake
  <table_name>:: Name of table
  <alias_name>:: Derived table alias name

Example: Iceberg

SEL * FROM TD_HISTORY(ON (iceberg_glue.db1.t1)) dt1;
 *** Query completed. 2 rows found. 2 columns returned.
 *** Total elapsed time was 2 seconds.
                  id            timestamp
--------------------  -------------------
 6384359091304721162  2024-09-03 19:11:58

Example: Delta Lake

SEL * FROM TD_HISTORY(ON (deltalake_unity.db1.t1)) dt1;
 *** Query completed. 2 rows found. 2 columns returned.
 *** Total elapsed time was 2 seconds.
                  id            timestamp
--------------------  -------------------
                   0  2024-02-15 20:29:32
                   1  2024-02-15 20:30:27