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.

    1. Rename table B to table A.
    2. Rename table A to table B.

    If swap is false, the operation is as follows:

    1. Drop table A.
    1. The swap parameter defaults to true. That is, the replacement table operation is equivalent to the exchange of two table data.
    2. If the swap parameter is set to false, the replaced table (table A) will be dropped and cannot be recovered.
    3. The replacement operation can only occur between two OLAP tables, and the table structure of the two tables is not checked for consistency.
    1. Atomic Overwrite Operation