Skip to main content
Version: 0.0.1

Updating Apache Iceberg Tables

The UPDATE command updates rows in a table.

{{< codeheader "Syntax" >}}

UPDATE <table_path>.<table_name> [AS alias]
SET <column1_name> = <value1> [, <column2_name> = <value2> ... ]
[ FROM <additional_table_or_query> [, <additional_table_or_query> ]
[ WHERE where_conditions ]

Parameters

{{< sql-section file="data/sql/apache-iceberg-tables.json" data="updating" >}}

{{< codeheader "Example UPDATE command using FROM and WHERE" >}}

UPDATE target 
SET v = b.v + c.v
FROM src b , (select k, min(v) v from src_new group by k having min(v) > 10) c
WHERE target.k = b.k and target.k = c.k;
For Dremio v22 and earlier:

Join conditions are not supported in WHERE clauses. If you need to use a join condition, use a MERGE statement.

Example of an unsupported UPDATE command
update t2 set id = id + t1.id from t1 where t1.name = t2.name;
Equivalent MERGE command
merge into t2 using t1 on (t1.name = t2.name) when matched then update set id = t2.id + t1.id;