tencent cloud

All product documents
Data Lake Compute
Last updated: 2024-08-07 17:26:27
UPDATE
Last updated: 2024-08-07 17:26:27

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?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon