Querying Tables - 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

Iceberg and Delta Lake tables can be queried in a SQL statement like any other database table. They are referenced using a 3-level dot notation: <datalakeName>.<databaseName>.<tableName>.

Examples of Select Queries

/* Simple SELECT using 3-level dot notation for Iceberg table*/
SELECT COUNT(*) FROM datalake_deltalake_glue.db1.t1;
 *** Query completed. One row found. One column returned.
 *** Total elapsed time was 2 seconds.
   Count(*)

-----------
          6

/* Queries with projection lists & predicates */
SELECT c1,c2 FROM Iceberg1.db1.t1 where order_date > ‘10-21-2020’ and make = ‘Buick’;  
/* Join BFS and OTF tables */
SELECT * FROM datalake_iceberg_glue.db1.t1  AS D WHERE loc_tbl.make = D.make;
/*Join two OTF derived tables from different data lakes */
WITH rtbl AS ( SELECT * FROM Iceberg_glue.db1.t1),
     ltbl AS ( SELECT * FROM Iceberg_unity.db2.t2)
    SELECT TOP 5 * FROM rtbl, ltbl;
/* Create Table as */
CREATE TABLE cdata_loc AS (SELECT * FROM iceberg_glue.d1.t1 as D) WITH DATA;