public class HiveCatalog extends AbstractCatalog
Catalog.ColumnAlreadyExistException, Catalog.ColumnNotExistException, Catalog.DatabaseAlreadyExistException, Catalog.DatabaseNotEmptyException, Catalog.DatabaseNotExistException, Catalog.Loader, Catalog.PartitionNotExistException, Catalog.ProcessSystemDatabaseException, Catalog.TableAlreadyExistException, Catalog.TableNotExistException| Modifier and Type | Field and Description |
|---|---|
static String |
HIVE_SITE_FILE |
static String |
PAIMON_TABLE_TYPE_VALUE |
static String |
TABLE_TYPE_PROP |
catalogOptions, fileIO, lineageMetaFactory, tableDefaultOptionsCOMMENT_PROP, DB_LOCATION_PROP, DB_SUFFIX, DEFAULT_DATABASE, SYSTEM_BRANCH_PREFIX, SYSTEM_DATABASE_NAME, SYSTEM_TABLE_SPLITTER, TABLE_DEFAULT_OPTION_PREFIX| Constructor and Description |
|---|
HiveCatalog(FileIO fileIO,
org.apache.hadoop.hive.conf.HiveConf hiveConf,
String clientClassName,
Options options,
String warehouse) |
HiveCatalog(FileIO fileIO,
org.apache.hadoop.hive.conf.HiveConf hiveConf,
String clientClassName,
String warehouse) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowUpperCase()
Return a boolean that indicates whether this catalog allow upper case.
|
protected void |
alterTableImpl(Identifier identifier,
List<SchemaChange> changes) |
void |
close() |
protected void |
createDatabaseImpl(String name,
Map<String,String> properties) |
static Catalog |
createHiveCatalog(CatalogContext context) |
static org.apache.hadoop.hive.conf.HiveConf |
createHiveConf(CatalogContext context) |
static org.apache.hadoop.hive.conf.HiveConf |
createHiveConf(String hiveConfDir,
String hadoopConfDir,
org.apache.hadoop.conf.Configuration defaultHadoopConf) |
protected void |
createTableImpl(Identifier identifier,
Schema schema) |
Optional<CatalogLockFactory> |
defaultLockFactory() |
protected void |
dropDatabaseImpl(String name) |
void |
dropPartition(Identifier identifier,
Map<String,String> partitionSpec)
Drop the partition of the specify table.
|
protected void |
dropTableImpl(Identifier identifier) |
TableSchema |
getDataTableSchema(Identifier identifier) |
FormatTable |
getFormatTable(Identifier identifier)
Return a
FormatTable identified by the given Identifier. |
static org.apache.hadoop.conf.Configuration |
getHadoopConfiguration(String hadoopConfDir)
Returns a new Hadoop Configuration object using the path to the hadoop conf configured.
|
org.apache.hadoop.hive.metastore.IMetaStoreClient |
getHmsClient() |
Path |
getTableLocation(Identifier identifier)
Get the table location in this catalog.
|
List<String> |
listDatabases()
Get the names of all databases in this catalog.
|
protected List<String> |
listTablesImpl(String databaseName) |
Map<String,String> |
loadDatabasePropertiesImpl(String name) |
Optional<CatalogLockContext> |
lockContext()
Get lock context for lock factory to create a lock.
|
Optional<MetastoreClient.Factory> |
metastoreClientFactory(Identifier identifier)
Get metastore client factory for the table specified by
identifier. |
static String |
possibleHiveConfPath() |
protected void |
renameTableImpl(Identifier fromTable,
Identifier toTable) |
void |
repairCatalog() |
void |
repairDatabase(String databaseName) |
void |
repairTable(Identifier identifier) |
boolean |
syncAllProperties() |
boolean |
tableExists(Identifier identifier)
Check if a table exists in this catalog.
|
String |
warehouse()
Warehouse root path containing all database directories in this catalog.
|
allTablePaths, alterTable, assertMainBranch, checkNotBranch, checkNotSystemDatabase, checkNotSystemTable, createDatabase, createTable, dropDatabase, dropTable, fileIO, getTable, isSpecifiedSystemTable, isSystemDatabase, isSystemTable, listDatabasesInFileSystem, listTables, listTablesInFileSystem, loadDatabaseProperties, lockEnabled, lockFactory, newDatabasePath, newDatabasePath, newTableLocation, options, renameTable, tableExistsInFileSystem, tableSchemaInFileSystem, validateFieldNameCaseInsensitive, validateIdentifierNameCaseInsensitiveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitalterTable, createDatabase, databaseExists, invalidateTable, tableDefaultOptions, validateCaseInsensitive, validateCaseInsensitivepublic static final String TABLE_TYPE_PROP
public static final String PAIMON_TABLE_TYPE_VALUE
public static final String HIVE_SITE_FILE
public HiveCatalog(FileIO fileIO, org.apache.hadoop.hive.conf.HiveConf hiveConf, String clientClassName, String warehouse)
public Optional<CatalogLockFactory> defaultLockFactory()
defaultLockFactory in class AbstractCatalogpublic Optional<CatalogLockContext> lockContext()
CataloglockContext in interface CataloglockContext in class AbstractCatalogpublic Optional<MetastoreClient.Factory> metastoreClientFactory(Identifier identifier)
Catalogidentifier.public Path getTableLocation(Identifier identifier)
CataloggetTableLocation in interface CataloggetTableLocation in class AbstractCatalogpublic List<String> listDatabases()
Catalogprotected void createDatabaseImpl(String name, Map<String,String> properties)
createDatabaseImpl in class AbstractCatalogpublic Map<String,String> loadDatabasePropertiesImpl(String name) throws Catalog.DatabaseNotExistException
loadDatabasePropertiesImpl in class AbstractCatalogCatalog.DatabaseNotExistExceptionpublic void dropPartition(Identifier identifier, Map<String,String> partitionSpec) throws Catalog.TableNotExistException
CatalogdropPartition in interface CatalogdropPartition in class AbstractCatalogidentifier - path of the table to drop partitionpartitionSpec - the partition to be deletedCatalog.TableNotExistException - if the table does not existprotected void dropDatabaseImpl(String name)
dropDatabaseImpl in class AbstractCatalogprotected List<String> listTablesImpl(String databaseName)
listTablesImpl in class AbstractCatalogpublic boolean tableExists(Identifier identifier)
Catalogidentifier - Path of the tablepublic TableSchema getDataTableSchema(Identifier identifier) throws Catalog.TableNotExistException
getDataTableSchema in class AbstractCatalogCatalog.TableNotExistExceptionpublic FormatTable getFormatTable(Identifier identifier) throws Catalog.TableNotExistException
AbstractCatalogFormatTable identified by the given Identifier.getFormatTable in class AbstractCatalogidentifier - Path of the tableCatalog.TableNotExistException - if the target does not existprotected void dropTableImpl(Identifier identifier)
dropTableImpl in class AbstractCatalogprotected void createTableImpl(Identifier identifier, Schema schema)
createTableImpl in class AbstractCatalogprotected void renameTableImpl(Identifier fromTable, Identifier toTable)
renameTableImpl in class AbstractCatalogprotected void alterTableImpl(Identifier identifier, List<SchemaChange> changes) throws Catalog.TableNotExistException, Catalog.ColumnAlreadyExistException, Catalog.ColumnNotExistException
alterTableImpl in class AbstractCatalogCatalog.TableNotExistExceptionCatalog.ColumnAlreadyExistExceptionCatalog.ColumnNotExistExceptionpublic boolean allowUpperCase()
CatalogallowUpperCase in interface CatalogallowUpperCase in class AbstractCatalogpublic boolean syncAllProperties()
public void repairCatalog()
public void repairDatabase(String databaseName)
public void repairTable(Identifier identifier) throws Catalog.TableNotExistException
Catalog.TableNotExistExceptionpublic String warehouse()
Catalog@VisibleForTesting public org.apache.hadoop.hive.metastore.IMetaStoreClient getHmsClient()
public static org.apache.hadoop.hive.conf.HiveConf createHiveConf(@Nullable String hiveConfDir, @Nullable String hadoopConfDir, org.apache.hadoop.conf.Configuration defaultHadoopConf)
public static Catalog createHiveCatalog(CatalogContext context)
public static org.apache.hadoop.hive.conf.HiveConf createHiveConf(CatalogContext context)
public static org.apache.hadoop.conf.Configuration getHadoopConfiguration(String hadoopConfDir)
hadoopConfDir - Hadoop conf directory path.public static String possibleHiveConfPath()
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.