Skip to main content

UPDATE

Update rows in a table.

note

Dremio supports reading positional deletes and equality deletes for Apache Iceberg v2 tables. Dremio performs writes using copy-on-write by default and supports writes using merge-on-read if specified in the Iceberg table properties.

Syntax
UPDATE <table_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.


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.

Make sure the columns adhere to NOT NULL constraints specified in the table definition, or else the UPDATE command fails with an error message.


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 
SET EXPR$0 = s.EXPR$1
FROM MYSOURCE.MYTABLE2
AS s