...
EXPORT and IMPORT commands are also available (as of Hive 0.8).
...
- Vectorization will be turned off for delete operations. This is automatic and requires no action on the part of the user. Non-delete operations are not affected. Tables with deleted data can still be queried using vectorization.
- In version 0.14 it is recommended that you set hive.optimize.sort.dynamic.partition=false when doing deletes, as this produces more efficient execution plans.
Merge
Note | ||
---|---|---|
| ||
MERGE is available starting in Hive 2.2. Merge can only be performed on tables that support ACID. See Hive Transactions for details. |
Syntax
Code Block |
---|
Standard Syntax:
MERGE INTO <target table> AS T USING <source expression/table> AS S
ON <boolean expression>
WHEN MATCHED [AND <boolean expression>] THEN UPDATE SET <set clause list>
WHEN MATCHED [AND <boolean expression>] THEN DELETE
WHEN NOT MATCHED [AND <boolean expression>] THEN INSERT VALUES<value list> |
Synopsis
- In Hive 2.2, upon successful completion of this operation the changes will be auto-committed.
Notes
- 1,2 or 3 WHEN clauses may be present; at most 1 of each type: UPDATE/DELETE/INSERT
- WHEN NOT MATCHED must be the last WHEN clause
- If both UPDATE and DELETE clauses are present, the 1st one in the statement must include [AND <boolean expression>]
- Vectorization will be turned off for merge operations. This is automatic and requires no action on the part of the user. Non-delete operations are not affected. Tables with deleted data can still be queried using vectorization.