AnalyticDB for MySQL allows you to execute the MSCK REPAIR TABLE statement to synchronize a partition from an Object Storage Service (OSS) external table to an AnalyticDB for MySQL cluster.

Prerequisites

The minor engine version of the cluster is 3.1.8.0 or later.
Note For more information about how to view the minor engine version of a cluster, see How can I view the version of an AnalyticDB for MySQL cluster? To update the minor engine version of a cluster, contact technical support.

Usage notes

The syntax is applicable only to partitions of OSS external tables other than AnalyticDB for MySQL tables.

Syntax

MSCK REPAIR TABLE table_name [SYNC_DIR 'Location'];

Parameters

ParameterDescription
table_nameThe name of the external table.
SYNC_DIR 'Location'Synchronizes the specified partition. If you do not specify this parameter, the entire table is synchronized. Location specifies the OSS path of the specified partition.

Examples

  • Synchronize the entire table.
    MSCK REPAIR TABLE adb_external_db.partition_table_test;
  • Synchronize the specified partition.
    MSCK REPAIR TABLE adb_external_db.partition_table_test SYNC_DIR 'oss://testBucketName/test_db/partition_table_test/dt=20220619';

References