Skip to main content

UPDATE

Update rows in a table.

note

Dremio supports reading Apache Iceberg v2 tables with positional deletes. Reading tables with equality deletes is not supported. Writes by Dremio are performed using copy-on-write. Writes using merge-on-read are not supported.

Syntax
UPDATE <table_name>
[ AT { REF[ERENCE] | BRANCH } <reference_name> ]
[ AS <alias> ]
SET <column1_name1> = <value1> [, <column_name2> = <value2> ... ]
[ WHERE where_conditions ]

Parameters

<table_name> String

The name of the source that you want to update a table in.


AT { REF[ERENCE] | BRANCH } <reference_name> String   Optional

Specifies the reference at which you want the table to be updated. When this parameter is omitted, the current branch is used.

REF: Identifies the specific reference.

BRANCH: Identifies the specific branch.

note

If AT BRANCH is specified, it will override the session context for the entire query including the SELECT portions.

note

If you specify the reference for the target table, you must also specify the reference for the source table.


AS <alias> String   Optional

The alias of the table.


SET <column1_name> = <value1> [, <column2_name> = <value2> ... ] String

Sets the value of one or more columns. The value can be any expression or sub-query that returns a single value.


WHERE where_conditions String   Optional

The filter for specifying which rows of the table to update.

Example

Specify the source table when specifying the target table
UPDATE MYSOURCE.MYTABLE AT BRANCH main
SET EXPR$0 = s.EXPR$1
FROM MYSOURCE.MYTABLE2 AT BRANCH main
AS s