Note
This parameter is available starting with V4.6.2.
Overview
The catalog_sync_target parameter specifies the target Catalog for data synchronization. It defines the type of HMS External Catalog used when synchronizing database and table metadata from the Internal Catalog to Hive Metastore (HMS).
After this parameter is set, new DDL operations generated under the current tenant's internal catalog will be automatically synchronized to the target HMS. This enables computing engines such as Spark and Daft to discover and query tables in OceanBase AI Database through HMS. When this parameter is set to an empty string, catalog data synchronization is disabled.
Privilege requirements
Query parameters
Both the
systenant and all user tenants can query this parameter using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify parameters
Both the
systenant and user tenants can modify this parameter.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | String |
| Default Value | Empty string |
| Value range | Empty string or the name of an HMS-type external catalog already created under the current tenant |
| Modifiable | Yes, you can use theALTER SYSTEM SETStatement modification. |
| Whether to restart the OBServer node for the change to take effect | No. The setting takes effect immediately and only applies to DDL operations that occur after the setting is configured. |
Usage instructions
This parameter is a tenant-level parameter and takes effect only for the current tenant. Different tenants can specify different synchronization target catalogs.
The target catalog must be an HMS-type external catalog created by the
CREATE EXTERNAL CATALOGstatement, and OceanBase AI Database must be able to access the HMS Thrift address corresponding to that catalog.After synchronization is enabled, it takes effect only on new DDL operations performed after the feature is enabled. Existing database tables are not automatically synchronized. To synchronize existing objects, you can use the
SYNC CATALOGstatement to manually synchronize them. For more information, see Manual catalog data synchronization.During synchronization,
RENAME TABLEandCTAS(CREATE TABLE AS SELECT) operations are not supported. They will be directly intercepted and an error will be returned when executed. To perform these operations, you must first disable synchronization, complete the operation, and then re-enable it.After you disable synchronization by setting the configuration value to null, the remote table becomes invisible immediately, while the local table remains unaffected. The placeholder tables registered in HMS are not automatically cleaned up. To remove them, you must delete them manually in HMS.
When you restart synchronization, if it points to the original Catalog, you need to reset this parameter. If it points to a different Catalog, the synchronization target will change to the HMS corresponding to the new Catalog. DDL statements generated during the period when synchronization is disabled cannot be retrospectively synchronized.
For more information about the scope of application, supported DDL operations, query semantics, and type mappings for catalog data synchronization, see Automatic catalog data synchronization.
Configuration example
Create an HMS-type external catalog.
For more syntax details, see CREATE EXTERNAL CATALOG.
CREATE EXTERNAL CATALOG hms_sync_catalog PROPERTIES ( TYPE = 'hms', URI = 'thrift://<hms-host>:<port>' );Enable catalog data synchronization.
ALTER SYSTEM SET catalog_sync_target = 'hms_sync_catalog';View the current configuration.
SHOW PARAMETERS LIKE 'catalog_sync_target';Stop catalog data synchronization.
ALTER SYSTEM SET catalog_sync_target = '';