Updated on 2025-08-06 GMT+08:00

Restoring Multi-Versioning Backup Data (Deprecated, Not Recommended)

Function

The multi-versioning feature is to be deprecated and is not recommended.

After the multiversion function is enabled, you can run the RESTORE TABLE statement to restore a table or partition of a specified version. For details about the syntax for enabling or disabling the multiversion function, see Enabling or Disabling Data Multi-Versioning (Deprecated, Not Recommended).

Currently, the multiversion function supports only OBS tables created using the Hive syntax. For details about the syntax for creating a table, see Creating an OBS Table Using the Hive Syntax.

Syntax

  • Restore the non-partitioned table data to the backup data of a specified version.
    RESTORE TABLE [db_name.]table_name TO VERSION 'version_id';
  • Restore the data of a single partition in a partitioned table to the backup data of a specified version.
    RESTORE TABLE [db_name.]table_name PARTITION (column = value, ...) TO VERSION 'version_id';

Keywords

Parameters

Table 1 Parameters

Parameter

Description

db_name

Database name, which consists of letters, digits, and underscores (_). The value cannot contain only digits or start with a digit or underscore (_).

table_name

Table name

column

Partition column name

value

Value corresponding to the partition column name

version_id

Target version of the backup data to be restored You can run the SHOW HISTORY command to obtain the version number. For details, see Viewing Multi-Versioning Backup Data (Deprecated, Not Recommended).

Precautions

Currently, the multiversion function supports only OBS tables created using the Hive syntax. For details about the syntax for creating a table, see Creating an OBS Table Using the Hive Syntax.

Example

  • Restore the data in non-partitioned table test_table to version 20210930.
    1
    RESTORE TABLE test_table TO VERSION '20210930';
    
  • Restore the data of partition dt in partitioned table test_table to version 20210930.
    1
    RESTORE TABLE test_table PARTITION (dt='2021-07-27') TO VERSION '20210930';