TD_PARTITIONS() function returns the partition information for a table.
Columns Returned
- id
- name
Syntax
[TD_SYSFNLIB.]TD_PARTITIONS( ON ( <datalake_name>.<database_name>.<table_name> ) ) <alias_name>;
Example: Iceberg
The following example shows that the datalake_iceberg_glue.db1.t1 table has two partition columns: country & city.
SELECT * FROM TD_PARTITIONS(ON (deltalake_glue.db1.t1)) D; *** Query completed. 2 rows found. 2 columns returned. *** Total elapsed time was 2 seconds. id name ----------- -------------------------------------------------------------------- 1000 country 1001 city
Example: Delta Lake
The following example shows that the datalake_deltalake_unity.db1.t1 table has one partition columns: c1.
select * from td_partitions(on (datalake_deltalake_unity.db1.t1)) D; *** Query completed. One row found. 2 columns returned. *** Total elapsed time was 2 seconds. id name ----------- -------------------------------------------------------------------- 0 c1