Replace Table
For partition level replacement operations, please refer to Temporary Partition Document
Replace table with table tbl2
.
If the swap
parameter is false
, after replacement, the data in the table named tbl1
is the data in the original tbl2
table. The table named tbl2
is dropped.
The replacement table function actually turns the following set of operations into an atomic operation.
- Rename table B to table A.
- Rename table A to table B.
If swap
is false
, the operation is as follows:
- Drop table A.
- The
swap
parameter defaults totrue
. That is, the replacement table operation is equivalent to the exchange of two table data. - If the
swap
parameter is set tofalse
, the replaced table (table A) will be dropped and cannot be recovered. - The replacement operation can only occur between two OLAP tables, and the table structure of the two tables is not checked for consistency.
Atomic Overwrite Operation