tencent cloud

Feedback

REPLACE TABLE AS SELECT

Last updated: 2024-08-07 17:12:31

    Description

    Supported engine: SparkSQL
    Applicable table: External and native Iceberg tables
    Purpose: Replace the table and update the snapshot while retaining the table history.

    Statement

    CREATE [OR REPLACE] TABLE table_identifier
    USING iceberg
    [ COMMENT table_comment ]
    [ PARTITIONED BY ( col_name1, transform(col_name2), ... ) ]
    [ LOCATION path ]
    [ TBLPROPERTIES ( property_name=property_value, ... ) ]
    AS select_statement

    Example

    CREATE OR REPLACE TABLE dempts_replace
    USING iceberg
    COMMENT 'table create as replace'
    PARTITIONED BY (eno, dno)
    TBLPROPERTIES ('write.format.default'='avro')
    LOCATION '/warehouse/db_001/dempts_replace'
    AS SELECT * from dempts;
    
    
    
    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 avaliable.

    7x24 Phone Support