Insert table data feature
From Hive and Impala, you can insert data into Iceberg tables using the familiar, single-table INSERT INTO command.
You can replace data in the table with the result of a query. To replace data, Hive and Impala dynamically overwrite partitions that have rows returned by the SELECT query. Partitions that do not have rows returned by the SELECT query, are not replaced. Using INSERT OVERWRITE on tables that use the BUCKET partition transform is not recommended. Results are unpredictable because dynamic overwrite behavior would be too random in this case.
The Hive Virtual Warehouse also supports, on a technical preview basis, inserting into multiple tables; however, this operation is not atomic, so data consistency of Iceberg tables is equivalent to that of Hive external tables. Changes within a single table will remain atomic.
Hive or Impala syntax
INSERT INTO TABLE tablename VALUES values_row [, values_row ...] INSERT INTO TABLE tablename1 select_statement1 FROM from_statement INSERT OVERWRITE TABLE tablename1 select_statement1 FROM from_statement;
Hive or Impala examples
INSERT INTO t VALUES (1, 'asf', true); INSERT INTO t SELECT * FROM s; INSERT OVERWRITE t SELECT * FROM s;
FROM customers INSERT INTO target1 SELECT customer_id, first_name INSERT INTO target2 SELECT last_name, customer_id;