Updated on 2024-10-09 GMT+08:00

REFRESH TABLE

Function

This command is used to register Carbon table data with the Hive metabase.

Syntax

REFRESH TABLE db_name.table_name;

Parameter Description

Table 1 REFRESH TABLE parameters

Parameter

Description

db_name

Database name. If this parameter is not specified, the current database is selected.

table_name

Table name.

Precautions

  • Before you run this command, copy the schema and data of the source table to the destination database.
  • For the repository of an earlier version, the time zones of the source and destination clusters must be the same.
  • The names of the destination database and the source database must be the same.
  • If you are using aggregate tables, all of them should be copied to the destination database.
  • If the source cluster uses Hive metabase to store the table structure, the refresh does not take effect because the schema file does not exist in the file system.

Example

REFRESH TABLE dbcarbon.productSalesTable;

Response

The source Carbon table data is registered with the Hive metabase.