Description
Supported engine: SparkSQL
Applicable table: Native Iceberg tables
Purpose: Update specified row in data table.
Statement
UPDATE tablePrimary
SET assign [, assign ]*
[ WHERE booleanExpression ]
Parameter
tablePrimary
: Table name in the three-part format. Example: catalog.database.table.
assign
: Expression for row update. Example: col1 = 'new_data'.
booleanExpression
: Boolean expression
Example
UPDATE prod.db.table
SET c1 = 'update_c1', c2 = 'update_c2'
WHERE ts >= '2020-05-01 00:00:00' and ts < '2020-06-01 00:00:00'
UPDATE prod.db.all_events
SET session_time = 0, ignored = true
WHERE session_time < (SELECT min(session_time) FROM prod.db.good_events)
UPDATE prod.db.orders AS t1
SET order_status = 'returned'
WHERE EXISTS (SELECT oid FROM prod.db.returned_orders WHERE t1.oid = oid)
Was this page helpful?