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 Multiversion Backup.
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.
RESTORE TABLE [db_name.]table_name TO VERSION 'version_id';
RESTORE TABLE [db_name.]table_name PARTITION (column = value, ...) TO VERSION 'version_id';
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 Multiversion Backup Data. |
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.
1 | RESTORE TABLE test_table TO VERSION '20210930'; |
1 | RESTORE TABLE test_table PARTITION (dt='2021-07-27') TO VERSION '20210930'; |