@InterfaceAudience.Public
@InterfaceStability.Stable
public interface HiveMetaHook
Implementations can use MetaStoreUtils.isExternalTable(org.apache.hadoop.hive.metastore.api.Table) to
distinguish external tables from managed tables.
| Modifier and Type | Field and Description |
|---|---|
static String |
ALLOW_PARTITION_KEY_CHANGE |
static List<String> |
allowedAlterTypes |
static String |
ALTER_TABLE_OPERATION_TYPE |
static String |
ALTERLOCATION |
static String |
EXTERNAL |
static String |
ICEBERG |
static String |
INITIALIZE_ROLLBACK_MIGRATION |
static String |
MIGRATE_HIVE_TO_ICEBERG |
static String |
OLD_DB_NAME |
static String |
OLD_TABLE_NAME |
static String |
PROPERTIES_SEPARATOR |
static String |
SET_PROPERTIES |
static String |
SKIP_METASTORE_ALTER |
static String |
TABLE_TYPE |
static String |
TRANSLATED_TO_EXTERNAL |
static String |
UNSET_PROPERTIES |
| Modifier and Type | Method and Description |
|---|---|
default void |
commitAlterTable(Table table,
EnvironmentContext context)
Called after a table is altered in the metastore during ALTER TABLE.
|
void |
commitCreateTable(Table table)
Called after successfully adding a new table definition to the metastore
during CREATE TABLE.
|
void |
commitDropTable(Table table,
boolean deleteData)
Called after successfully removing a table definition from the metastore
during DROP TABLE.
|
default boolean |
createHMSTableInHook()
Returns true if the HMS table should be created by the implementing class.
|
default void |
postGetTable(Table table)
Set storage handler specific table properties
|
default void |
preAlterTable(Table table,
EnvironmentContext context)
Called before a table is altered in the metastore
during ALTER TABLE.
|
default void |
preCreateTable(CreateTableRequest request)
Called before a new table definition is added to the metastore
during CREATE TABLE.
|
void |
preCreateTable(Table table)
Called before a new table definition is added to the metastore
during CREATE TABLE.
|
default void |
preDropPartitions(Table table,
EnvironmentContext context,
List<org.apache.commons.lang3.tuple.Pair<Integer,byte[]>> partExprs)
Called before dropping the partitions from the table in the metastore during ALTER TABLE DROP PARTITION.
|
void |
preDropTable(Table table)
Called before a table definition is removed from the metastore
during DROP TABLE.
|
default void |
preDropTable(Table table,
boolean deleteData)
Called before a table definition is removed from the metastore
during DROP TABLE
|
default void |
preTruncateTable(Table table,
EnvironmentContext context)
Called before deleting the data and statistics from the table in the metastore during TRUNCATE TABLE.
|
default void |
preTruncateTable(Table table,
EnvironmentContext context,
List<String> partNames) |
default void |
rollbackAlterTable(Table table,
EnvironmentContext context)
Called after failure altering a table definition from the metastore
during ALTER TABLE
|
void |
rollbackCreateTable(Table table)
Called after failure adding a new table definition to the metastore
during CREATE TABLE.
|
void |
rollbackDropTable(Table table)
Called after failure removing a table definition from the metastore
during DROP TABLE.
|
static final String ALTER_TABLE_OPERATION_TYPE
static final String ALTERLOCATION
static final String ALLOW_PARTITION_KEY_CHANGE
static final String SET_PROPERTIES
static final String UNSET_PROPERTIES
static final String TRANSLATED_TO_EXTERNAL
static final String TABLE_TYPE
static final String EXTERNAL
static final String ICEBERG
static final String PROPERTIES_SEPARATOR
static final String MIGRATE_HIVE_TO_ICEBERG
static final String INITIALIZE_ROLLBACK_MIGRATION
static final String SKIP_METASTORE_ALTER
static final String OLD_TABLE_NAME
static final String OLD_DB_NAME
void preCreateTable(Table table) throws MetaException
table - new table definitionMetaExceptiondefault void preCreateTable(CreateTableRequest request) throws MetaException
request - the whole request to create a new tableMetaExceptionvoid rollbackCreateTable(Table table) throws MetaException
table - new table definitionMetaExceptionvoid commitCreateTable(Table table) throws MetaException
table - new table definitionMetaExceptionvoid preDropTable(Table table) throws MetaException
table - table definitionMetaExceptiondefault void preDropTable(Table table, boolean deleteData) throws MetaException
table - table definitiondeleteData - whether to delete data as well; this should typically
be ignored in the case of an external tableMetaExceptionvoid rollbackDropTable(Table table) throws MetaException
table - table definitionMetaExceptionvoid commitDropTable(Table table, boolean deleteData) throws MetaException
table - table definitiondeleteData - whether to delete data as well; this should typically
be ignored in the case of an external tableMetaExceptiondefault void preAlterTable(Table table, EnvironmentContext context) throws MetaException
table - new table definitionMetaExceptiondefault void commitAlterTable(Table table, EnvironmentContext context) throws MetaException
table - new table definitioncontext - environment context, containing information about the alter operation typeMetaExceptiondefault void rollbackAlterTable(Table table, EnvironmentContext context) throws MetaException
table - new table definitioncontext - context of the alter operationMetaExceptiondefault void preTruncateTable(Table table, EnvironmentContext context) throws MetaException
table - table to be truncatedcontext - context of the truncate operationMetaExceptiondefault void preTruncateTable(Table table, EnvironmentContext context, List<String> partNames) throws MetaException
MetaExceptiondefault boolean createHMSTableInHook()
default void postGetTable(Table table)
table - default void preDropPartitions(Table table, EnvironmentContext context, List<org.apache.commons.lang3.tuple.Pair<Integer,byte[]>> partExprs) throws MetaException
table - table whose partition needs to be droppedcontext - context of the operationpartExprs - List of partition expressionsMetaExceptionCopyright © 2024 The Apache Software Foundation. All rights reserved.