Create partitioned table as select feature

From Hive, you can create a partitioned Iceberg table by selecting another table. You learn how to use PARTITIONED BY and TBLPROPERTIES to declare the partition spec and table properties for the new table.

The newly created table does not inherit the partition spec and table properties from the source table in SELECT. The Iceberg table and the corresponding Hive table are created at the beginning of the query execution. The data is inserted / committed when the query finishes. So for a transient period the table exists but contains no data.

Hive syntax

CREATE TABLE prod.db.sample
    USING iceberg
    TBLPROPERTIES ('key'='value')
    AS SELECT ...