UPDATE table_name SET column_name = expression[, column_name = expression, ... ] [ WHERE condition ]
UPDATE changes the values of the specified columns in all rows that satisfy the condition. Only the columns to be modified need be mentioned in the SET clause; columns not explicitly modified retain their previous values.
users, change the name
Francisco where the
id equal to 1:
UPDATE users SET name = 'Francisco' WHERE id=1;
- Right now only Hive Connector and transactional ORC table support
- The set expression does not support subquery.
- Direct column reference is supported, but NOT expression with column reference.
UPDATEcannot be applied to view.
UPDATEdose not support implicitly data type conversion, please use
CASTwhen value does not match target column’s data type.
- If the table is partitioned and/or bucketed, bucket_column and partition column cannot be updated. i.e They cannot be target of SET expression.