CATALOG_SYNC_MODE global variable
The CATALOG_SYNC_MODE global variable controls whether DDL operations attempt to keep the local database catalog in synchronization with the Hive catalogs.
By using the CATALOG_SYNC_MODE session variable, the local catalogs and the Hive catalogs are synchronized with any DDL operations.
When the value is enabled, every operation that is done on the local catalog is also done on the Hive catalogs. By using this variable, you can correct discrepancies between the local database catalogs in the Hive catalogs.
This global session variable has the following characteristics:
- The default is true, which can be designated with any of the following values: 1,Y,y,T,t. Any other character is a value of false.
- The type is CHAR(1).
- The schema is SYSHADOOP.
- The scope of this global variable is session.
Examples
If you change the definition of a table by using a HIVE command, which is an
external change, you can reconstruct the table definition by using the following
commands:
SET SYSHADOOP.CATALOG_SYNC_MODE='N';
DROP TABLE T1;
CALL SYSHADOOP.HCAT_SYNC_OBJECTS('MYSCHEMA', 'T1');
SET SYSHADOOP.CATALOG_SYNC_MODE='Y';
If you change the definition of a table by using a HIVE command, you can recreate the
table in ADMIN
mode:
SET SYSHADOOP.CATALOG_SYNC_MODE='N';
DROP TABLE T1;
CREATE HADOOP TABLE T1 (C1 INT, … );
SET SYSHADOOP.CATALOG_SYNC_MODE='Y';
If a schema is defined in HIVE but that schema does not exist in the local database environment, the schema can
be defined in ADMIN
mode:
SET SYSHADOOP.CATALOG_SYNC_MODE='N';
CREATE SCHEMA my_schema;
SET SYSHADOOP.CATALOG_SYNC_MODE='Y';