Updated on 2025-04-21 GMT+08:00

UPDATE

Function

This command updates a Delta table based on column expressions and optional filter conditions.

Syntax

UPDATE [database_name.]table_name|DELTA.`obs://bucket_name/tbl_path`

SET column = EXPRESSION(,column = EXPRESSION)

[ WHERE boolExpression]

Parameter Description

Table 1 Parameter descriptions of UPDATE

Parameter

Description

database_name

Name of the database, consisting of letters, numbers, and underscores (_)

table_name

Name of the table in the database, consisting of letters, numbers, and underscores (_)

bucket_name

OBS bucket name

tbl_path

Storage location of the Delta table in the OBS bucket

column

Target column to be updated

EXPRESSION

Expression of the source table column to be updated in the target table

boolExpression

Filter condition expression

Required Permissions

  • SQL permissions
Table 2 Permissions required for executing UPDATE

Permission Description

UPDATE permission on a table

  • Fine-grained permission: dli:table:update
  • Metadata services provided by LakeFormation. Refer to the LakeFormation documentation for details on permission configuration.

Examples

update delta_table0 set price = price + 20 where id = 1;

update delta.`obs://bucket0/db0/delta_table1` set price = price *2, name = 'a2' where part0='xx' and id = 2;

System Response

You can view the result in driver logs or on the client.