Updated on 2024-07-04 GMT+08:00

Checking Multiversion Backup Data

Function

After the multiversion function is enabled, you can run the SHOW HISTORY command to view the backup data of a table. 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.

Syntax

  • View the backup data of a non-partitioned table.
    SHOW HISTORY FOR TABLE [db_name.]table_name;
  • View the backup data of a specified partition.
    SHOW HISTORY FOR TABLE [db_name.]table_name PARTITION (column = value, ...);

Keywords

  • SHOW HISTORY FOR TABLE: Used to view backup data
  • PARTITION: Used to specify the partition column

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

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

  • View multiversion backup data of the test_table table.
    1
    SHOW HISTORY FOR TABLE test_table;
    
  • View multiversion backup data of the dt partition in the test_table partitioned table.
    1
    SHOW HISTORY FOR TABLE test_table PARTITION (dt='2021-07-27');