Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Public Member Functions | |
CatalogOpExecutor (CatalogServiceCatalog catalog) | |
TDdlExecResponse | execDdlRequest (TDdlExecRequest ddlRequest) throws ImpalaException |
long | updateLastDdlTime (org.apache.hadoop.hive.metastore.api.Table msTbl, MetaStoreClient msClient) throws MetaException, NoSuchObjectException, TException |
TResetMetadataResponse | execResetMetadata (TResetMetadataRequest req) throws CatalogException |
TUpdateCatalogResponse | updateCatalog (TUpdateCatalogRequest update) throws ImpalaException |
Table | getExistingTable (String dbName, String tblName) throws CatalogException |
Static Public Member Functions | |
static List< FieldSchema > | buildFieldSchemaList (List< TColumn > columns) |
static org.apache.hadoop.hive.metastore.api.Table | createMetaStoreTable (TCreateTableParams params) |
Private Member Functions | |
void | alterTable (TAlterTableParams params, TDdlExecResponse response) throws ImpalaException |
Table | addHdfsPartition (TableName tableName, Partition partition) throws CatalogException |
void | alterView (TCreateOrAlterViewParams params, TDdlExecResponse resp) throws ImpalaException |
void | alterTableUpdateStats (TAlterTableUpdateStatsParams params, TDdlExecResponse resp) throws ImpalaException |
int | updateTableStats (Table table, TAlterTableUpdateStatsParams params, org.apache.hadoop.hive.metastore.api.Table msTbl, List< HdfsPartition > partitions, List< HdfsPartition > modifiedParts) throws ImpalaException |
void | createDatabase (TCreateDbParams params, TDdlExecResponse resp) throws ImpalaException |
void | createFunction (TCreateFunctionParams params, TDdlExecResponse resp) throws ImpalaException |
void | createDataSource (TCreateDataSourceParams params, TDdlExecResponse resp) throws ImpalaException |
void | dropDataSource (TDropDataSourceParams params, TDdlExecResponse resp) throws ImpalaException |
void | dropStats (TDropStatsParams params, TDdlExecResponse resp) throws ImpalaException |
int | dropColumnStats (Table table) throws ImpalaRuntimeException |
int | dropTableStats (Table table) throws ImpalaRuntimeException |
void | dropDatabase (TDropDbParams params, TDdlExecResponse resp) throws ImpalaException |
void | dropTableOrView (TDropTableOrViewParams params, TDdlExecResponse resp) throws ImpalaException |
void | dropFunction (TDropFunctionParams params, TDdlExecResponse resp) throws ImpalaException |
boolean | createTable (TCreateTableParams params, TDdlExecResponse response) throws ImpalaException |
void | createView (TCreateOrAlterViewParams params, TDdlExecResponse response) throws ImpalaException |
void | createTableLike (TCreateTableLikeParams params, TDdlExecResponse response) throws ImpalaException |
boolean | createTable (org.apache.hadoop.hive.metastore.api.Table newTable, boolean ifNotExists, THdfsCachingOp cacheOp, TDdlExecResponse response) throws ImpalaException |
void | setViewAttributes (TCreateOrAlterViewParams params, org.apache.hadoop.hive.metastore.api.Table view) |
void | alterTableAddReplaceCols (TableName tableName, List< TColumn > columns, boolean replaceExistingCols) throws ImpalaException |
void | alterTableChangeCol (TableName tableName, String colName, TColumn newCol) throws ImpalaException |
Table | alterTableAddPartition (TableName tableName, List< TPartitionKeyValue > partitionSpec, boolean ifNotExists, String location, THdfsCachingOp cacheOp) throws ImpalaException |
Table | alterTableDropPartition (TableName tableName, List< TPartitionKeyValue > partitionSpec, boolean ifExists) throws ImpalaException |
void | alterTableDropCol (TableName tableName, String colName) throws ImpalaException |
void | alterTableOrViewRename (TableName tableName, TableName newTableName, TDdlExecResponse response) throws ImpalaException |
void | alterTableSetFileFormat (TableName tableName, List< TPartitionKeyValue > partitionSpec, THdfsFileFormat fileFormat) throws ImpalaException |
void | alterTableSetLocation (TableName tableName, List< TPartitionKeyValue > partitionSpec, String location) throws ImpalaException |
void | alterTableSetTblProperties (TableName tableName, TAlterTableSetTblPropertiesParams params) throws ImpalaException |
void | alterTableSetCached (TableName tableName, TAlterTableSetCachedParams params) throws ImpalaException |
void | alterPartitionSetCached (TableName tableName, TAlterTableSetCachedParams params) throws ImpalaException |
void | applyAlterTable (org.apache.hadoop.hive.metastore.api.Table msTbl) throws ImpalaRuntimeException |
void | applyAlterPartition (TableName tableName, HdfsPartition partition) throws ImpalaException |
void | createDropRole (User requestingUser, TCreateDropRoleParams createDropRoleParams, TDdlExecResponse resp) throws ImpalaException |
void | grantRevokeRoleGroup (User requestingUser, TGrantRevokeRoleParams grantRevokeRoleParams, TDdlExecResponse resp) throws ImpalaException |
void | grantRevokeRolePrivilege (User requestingUser, TGrantRevokePrivParams grantRevokePrivParams, TDdlExecResponse resp) throws ImpalaException |
void | verifySentryServiceEnabled () throws CatalogException |
void | bulkAlterPartitions (String dbName, String tableName, List< HdfsPartition > modifiedParts) throws ImpalaRuntimeException |
org.apache.hadoop.hive.metastore.api.Table | getMetaStoreTable (TableName tableName) throws CatalogException |
List< String > | getPartValsFromName (org.apache.hadoop.hive.metastore.api.Table msTbl, String partName) throws MetaException, CatalogException |
Static Private Member Functions | |
static ColumnStatistics | createHiveColStats (Map< String, TColumnStats > columnStats, Table table) |
static ColumnStatisticsData | createHiveColStatsData (TColumnStats colStats, Type colType) |
static void | setStorageDescriptorFileFormat (StorageDescriptor sd, THdfsFileFormat fileFormat) |
static TCatalogObject | TableToTCatalogObject (Table table) |
static long | calculateDdlTime (org.apache.hadoop.hive.metastore.api.Table msTbl) |
Private Attributes | |
final CatalogServiceCatalog | catalog_ |
final Object | metastoreDdlLock_ = new Object() |
Static Private Attributes | |
static final String | HMS_RPC_ERROR_FORMAT_STR |
static final Logger | LOG = Logger.getLogger(CatalogOpExecutor.class) |
static final short | MAX_PARTITION_UPDATES_PER_RPC = 500 |
Class used to execute Catalog Operations, including DDL and refresh/invalidate metadata requests. Acts as a bridge between the Thrift catalog operation requests and the non-thrift Java Catalog objects. TODO: Create a Hive Metastore utility class to move code that interacts with the metastore out of this class.
Definition at line 154 of file CatalogOpExecutor.java.
|
inline |
Definition at line 171 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_.
|
inlineprivate |
Creates a new HdfsPartition object and adds it to the corresponding HdfsTable. Does not create the object in the Hive metastore.
Definition at line 368 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.getExistingTable().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition().
|
inlineprivate |
Caches or uncaches the HDFS location of the target partition and updates the partition's metadata in Hive Metastore Store. If a partition is being cached, the partition properties will have the ID of the cache directive added. If the partition is being uncached, any outstanding cache directive will be dropped and the cache directive ID property key will be cleared.
Definition at line 1796 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.catalog.HdfsPartition.getParameters(), com.cloudera.impala.catalog.HdfsPartition.isMarkedCached(), com.cloudera.impala.util.HdfsCachingUtil.isUpdateOp(), and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Execute the ALTER TABLE command according to the TAlterTableParams and refresh the table metadata, except for RENAME, ADD PARTITION and DROP PARTITION.
Definition at line 262 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.alterPartitionSetCached(), com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableAddReplaceCols(), com.cloudera.impala.service.CatalogOpExecutor.alterTableChangeCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetCached(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetFileFormat(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetLocation(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetTblProperties(), com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats(), com.cloudera.impala.analysis.TableName.fromThrift(), and com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Adds a new partition to the given table in Hive. Also creates and adds a new HdfsPartition to the corresponding HdfsTable. If cacheOp is not null, the partition's location will be cached according to the cacheOp. If cacheOp is null, the new partition will inherit the the caching properties of the parent table. Returns null if the partition already exists in Hive and "IfNotExists" is true. Otherwise, returns the table object with an updated catalog version.
Definition at line 1306 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.addHdfsPartition(), com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.containsHdfsPartition(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.service.CatalogOpExecutor.updateLastDdlTime().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Appends one or more columns to the given table, optionally replacing all existing columns.
Definition at line 1250 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.buildFieldSchemaList(), and com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Changes the column definition of an existing column. This can be used to rename a column, add a comment to a column, or change the datatype of a column.
Definition at line 1270 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Removes a column from the given table.
Definition at line 1457 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Drops an existing partition from the given table in Hive. If the partition is cached, the associated cache directive will also be removed. Also drops the partition from its Hdfs table. Returns the table object with an updated catalog version. If the partition does not exist and "IfExists" is true, null is returned.
Definition at line 1406 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.containsHdfsPartition(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.catalog.HdfsPartition.isMarkedCached(), com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.service.CatalogOpExecutor.updateLastDdlTime().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Renames an existing table or view. Saves, drops and restores the column stats for tables renamed across databases to work around HIVE-9720/IMPALA-1711. After renaming the table/view, its metadata is marked as invalid and will be reloaded on the next access.
Definition at line 1485 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.service.CatalogOpExecutor.createHiveColStats(), com.cloudera.impala.catalog.Table.getColumns(), com.cloudera.impala.service.CatalogOpExecutor.getExistingTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, com.cloudera.impala.catalog.CatalogServiceCatalog.renameTable(), and com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Caches or uncaches the HDFS location of the target table and updates the table's metadata in Hive Metastore Store. If this is a partitioned table, all uncached partitions will also be cached. The table/partition metadata will be updated to include the ID of each cache directive that was submitted. If the table is being uncached, any outstanding cache directives will be dropped and the cache directive ID property key will be cleared.
Definition at line 1680 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getExistingTable(), com.cloudera.impala.catalog.HdfsTable.getPartitions(), and com.cloudera.impala.util.HdfsCachingUtil.isUpdateOp().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Changes the file format for the given table or partition. This is a metadata only operation, existing table data will not be converted to the new format. After changing the file format the table metadata is marked as invalid and will be reloaded on the next access.
Definition at line 1560 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.service.CatalogOpExecutor.setStorageDescriptorFileFormat().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Changes the HDFS storage location for the given table. This is a metadata only operation, existing table data will not be as part of changing the location.
Definition at line 1601 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Appends to the table or partition property metadata for the given table, replacing the values of any keys that already exist.
Definition at line 1628 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Alters an existing table's table and column statistics. Partitions are updated in batches of size 'MAX_PARTITION_UPDATES_PER_RPC'.
Definition at line 418 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.bulkAlterPartitions(), com.cloudera.impala.service.CatalogOpExecutor.createHiveColStats(), com.cloudera.impala.catalog.Table.getDb(), com.cloudera.impala.service.CatalogOpExecutor.getExistingTable(), com.cloudera.impala.catalog.Table.getName(), com.cloudera.impala.catalog.HdfsTable.getPartitions(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, com.cloudera.impala.catalog.Type.STRING, com.cloudera.impala.catalog.ScalarType.toThrift(), and com.cloudera.impala.service.CatalogOpExecutor.updateTableStats().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().
|
inlineprivate |
Alters an existing view's definition in the metastore. Throws an exception if the view does not exist or if the existing metadata entry is a table instead of a a view.
Definition at line 385 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, com.cloudera.impala.service.CatalogOpExecutor.setViewAttributes(), com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject(), and com.cloudera.impala.analysis.TableName.toString().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Definition at line 1872 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, and com.cloudera.impala.service.CatalogOpExecutor.updateLastDdlTime().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterPartitionSetCached(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetCached(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetFileFormat(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetLocation(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetTblProperties(), and com.cloudera.impala.service.CatalogOpExecutor.dropStats().
|
inlineprivate |
Applies an ALTER TABLE command to the metastore table. The caller should take the metastoreDdlLock before calling this method. Note: The metastore interface is not very safe because it only accepts an entire metastore.api.Table object rather than a delta of what to change. This means an external modification to the table could be overwritten by an ALTER TABLE command if the metadata is not completely in-sync. This affects both Hive and Impala, but is more important in Impala because the metadata is cached for a longer period of time.
Definition at line 1853 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.calculateDdlTime(), and com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddReplaceCols(), com.cloudera.impala.service.CatalogOpExecutor.alterTableChangeCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetCached(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetFileFormat(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetLocation(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetTblProperties(), com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats(), com.cloudera.impala.service.CatalogOpExecutor.alterView(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), and com.cloudera.impala.service.CatalogOpExecutor.dropTableStats().
|
inlinestatic |
|
inlineprivate |
Alters partitions in batches of size 'MAX_PARTITION_UPDATES_PER_RPC'. This reduces the time spent in a single update and helps avoid metastore client timeouts.
Definition at line 2019 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.service.CatalogOpExecutor.MAX_PARTITION_UPDATES_PER_RPC, and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats(), and com.cloudera.impala.service.CatalogOpExecutor.dropTableStats().
|
inlinestaticprivate |
Calculates the next transient_lastDdlTime value.
Definition at line 2107 of file CatalogOpExecutor.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), and com.cloudera.impala.service.CatalogOpExecutor.updateLastDdlTime().
|
inlineprivate |
Creates a new database in the metastore and adds the db name to the internal metadata cache, marking its metadata to be lazily loaded on the next access. Re-throws any Hive Meta Store exceptions encountered during the create, these may vary depending on the Meta Store connection type (thrift vs direct db).
Definition at line 658 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogVersion(), com.cloudera.impala.catalog.Catalog.getDb(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.catalog.Catalog.INITIAL_CATALOG_VERSION, and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Definition at line 731 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.getDataSource(), com.cloudera.impala.catalog.DataSource.getName(), and com.cloudera.impala.service.CatalogOpExecutor.LOG.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Creates or drops a Sentry role on behalf of the requestingUser.
Definition at line 1891 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.verifySentryServiceEnabled().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Definition at line 711 of file CatalogOpExecutor.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlinestaticprivate |
Create Hive column statistics for the given table based on the give map from column name to column stats. Missing or new columns as a result of concurrent table alterations are ignored.
Definition at line 580 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.createHiveColStatsData(), com.cloudera.impala.catalog.Table.getDb(), and com.cloudera.impala.catalog.Table.getName().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), and com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats().
|
inlinestaticprivate |
Definition at line 606 of file CatalogOpExecutor.java.
References com.cloudera.impala.catalog.Type.getPrimitiveType().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.createHiveColStats().
|
inlinestatic |
Utility function that creates a hive.metastore.api.Table object based on the given TCreateTableParams. TODO: Extract metastore object creation utility functions into a separate helper/factory class.
Definition at line 2122 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.buildFieldSchemaList(), and com.cloudera.impala.catalog.RowFormat.fromThrift().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.createTable().
|
inlineprivate |
Creates a new table in the metastore and adds an entry to the metadata cache to lazily load the new metadata on the next access. Re-throws any Hive Meta Store exceptions encountered during the create.
Definition at line 1050 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.containsTable(), com.cloudera.impala.service.CatalogOpExecutor.createMetaStoreTable(), and com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogVersion().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.service.CatalogOpExecutor.createTableLike(), com.cloudera.impala.service.CatalogOpExecutor.createView(), and com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Creates a new table in the HMS. If ifNotExists=true, no error will be thrown if the table already exists, otherwise an exception will be thrown. Accepts an optional 'cacheOp' param, which if specified will cache the table's HDFS location according to the 'cacheOp' spec after creation. Stores details of the operations (such as the resulting catalog version) in 'response' output parameter. Returns true if a new table was created as part of this call, false otherwise.
Definition at line 1172 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject().
|
inlineprivate |
Creates a new table in the metastore based on the definition of an existing table. No data is copied as part of this process, it is a metadata only operation. If the creation succeeds, an entry is added to the metadata cache to lazily load the new table's metadata on the next access.
Definition at line 1104 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.containsTable(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogVersion(), com.cloudera.impala.analysis.TableName.getDb(), com.cloudera.impala.service.CatalogOpExecutor.getExistingTable(), and com.cloudera.impala.service.CatalogOpExecutor.setStorageDescriptorFileFormat().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Creates a new view in the metastore and adds an entry to the metadata cache to lazily load the new metadata on the next access. Re-throws any Metastore exceptions encountered during the create.
Definition at line 1077 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.containsTable(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.analysis.TableName.getDb(), and com.cloudera.impala.service.CatalogOpExecutor.setViewAttributes().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Drops all column stats from the table in the HMS. Returns the number of columns that were updated as part of this operation.
Definition at line 827 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.dropStats().
|
inlineprivate |
Drops a database from the metastore and removes the database's metadata from the internal cache. The database must be empty (contain no tables) for the drop operation to succeed. Re-throws any Hive Meta Store exceptions encountered during the drop.
Definition at line 916 of file CatalogOpExecutor.java.
References com.cloudera.impala.catalog.Db.getName(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.catalog.Db.numFunctions().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Definition at line 754 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.LOG.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Definition at line 1017 of file CatalogOpExecutor.java.
References com.cloudera.impala.analysis.FunctionName.fromThrift(), com.cloudera.impala.catalog.Type.INVALID, and com.cloudera.impala.catalog.Function.signatureString().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Drops all table and column stats from the target table in the HMS and updates the Impala catalog. Throws an ImpalaException if any errors are encountered as part of this operation.
Definition at line 782 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.service.CatalogOpExecutor.dropColumnStats(), com.cloudera.impala.service.CatalogOpExecutor.dropTableStats(), com.cloudera.impala.service.CatalogOpExecutor.getExistingTable(), com.cloudera.impala.catalog.HdfsPartition.getPartitionStats(), com.cloudera.impala.catalog.Table.getTableName(), com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Drops a table or view from the metastore and removes it from the catalog. Also drops all associated caching requests on the table and/or table's partitions, uncaching all table data.
Definition at line 960 of file CatalogOpExecutor.java.
References com.cloudera.impala.analysis.TableName.getDb(), com.cloudera.impala.catalog.Table.getNumClusteringCols(), com.cloudera.impala.catalog.HdfsTable.getPartitions(), com.cloudera.impala.analysis.TableName.getTbl(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.catalog.HdfsTable.isMarkedCached(), and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Drops all table and partition stats from this table in the HMS. Partitions are updated in batches of MAX_PARTITION_UPDATES_PER_RPC. Returns the number of partitions updated as part of this operation, or 1 if the table is unpartitioned.
Definition at line 865 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.bulkAlterPartitions(), and com.cloudera.impala.catalog.HdfsTable.getPartitions().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.dropStats().
|
inline |
Definition at line 175 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.alterTable(), com.cloudera.impala.service.CatalogOpExecutor.alterView(), com.cloudera.impala.service.CatalogOpExecutor.createDatabase(), com.cloudera.impala.service.CatalogOpExecutor.createDataSource(), com.cloudera.impala.service.CatalogOpExecutor.createDropRole(), com.cloudera.impala.service.CatalogOpExecutor.createFunction(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.service.CatalogOpExecutor.createTableLike(), com.cloudera.impala.service.CatalogOpExecutor.createView(), com.cloudera.impala.service.CatalogOpExecutor.dropDatabase(), com.cloudera.impala.service.CatalogOpExecutor.dropDataSource(), com.cloudera.impala.service.CatalogOpExecutor.dropFunction(), com.cloudera.impala.service.CatalogOpExecutor.dropStats(), com.cloudera.impala.service.CatalogOpExecutor.dropTableOrView(), com.cloudera.impala.service.JniCatalog.getServiceId(), com.cloudera.impala.service.CatalogOpExecutor.grantRevokeRoleGroup(), and com.cloudera.impala.service.CatalogOpExecutor.grantRevokeRolePrivilege().
|
inline |
Executes a TResetMetadataRequest and returns the result as a TResetMetadataResponse. Based on the request parameters, this operation may do one of three things: 1) invalidate the entire catalog, forcing the metadata for all catalog objects to be reloaded. 2) invalidate a specific table, forcing the metadata to be reloaded on the next access. 3) perform a synchronous incremental refresh of a specific table.
For details on the specific commands see comments on their respective methods in CatalogServiceCatalog.java.
Definition at line 2185 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.JniCatalog.getServiceId(), and com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject().
|
inline |
Returns an existing, loaded table from the Catalog. Throws an exception if any of the following are true:
Definition at line 2468 of file CatalogOpExecutor.java.
References com.cloudera.impala.catalog.Table.isLoaded().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.addHdfsPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetCached(), com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats(), com.cloudera.impala.service.CatalogOpExecutor.createTableLike(), com.cloudera.impala.service.CatalogOpExecutor.dropStats(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), and com.cloudera.impala.service.CatalogOpExecutor.updateCatalog().
|
inlineprivate |
Returns a deep copy of the metastore.api.Table object for the given TableName.
Definition at line 2055 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.getExistingTable().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableAddReplaceCols(), com.cloudera.impala.service.CatalogOpExecutor.alterTableChangeCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetFileFormat(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetLocation(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetTblProperties(), com.cloudera.impala.service.CatalogOpExecutor.alterView(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), and com.cloudera.impala.service.CatalogOpExecutor.updateCatalog().
|
inlineprivate |
Definition at line 2439 of file CatalogOpExecutor.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.updateCatalog().
|
inlineprivate |
Grants or revokes a Sentry role to/from the given group on behalf of the requestingUser.
Definition at line 1927 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.verifySentryServiceEnabled().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlineprivate |
Grants or revokes one or more privileges to/from a Sentry role on behalf of the requestingUser.
Definition at line 1956 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.verifySentryServiceEnabled().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().
|
inlinestaticprivate |
Helper method for setting the file format on a given storage descriptor.
Definition at line 1588 of file CatalogOpExecutor.java.
References com.cloudera.impala.catalog.RowFormat.DEFAULT_ROW_FORMAT.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableSetFileFormat(), and com.cloudera.impala.service.CatalogOpExecutor.createTableLike().
|
inlineprivate |
Sets the given params in the metastore table as appropriate for a view.
Definition at line 1225 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.buildFieldSchemaList().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterView(), and com.cloudera.impala.service.CatalogOpExecutor.createView().
|
inlinestaticprivate |
Definition at line 2075 of file CatalogOpExecutor.java.
References com.cloudera.impala.catalog.Catalog.INITIAL_CATALOG_VERSION.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable(), com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), com.cloudera.impala.service.CatalogOpExecutor.alterView(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.service.CatalogOpExecutor.dropStats(), com.cloudera.impala.service.CatalogOpExecutor.execResetMetadata(), and com.cloudera.impala.service.CatalogOpExecutor.updateCatalog().
|
inline |
Create any new partitions required as a result of an INSERT statement and refreshes the table metadata after every INSERT statement. Any new partitions will inherit their cache configuration from the parent table. That is, if the parent is cached new partitions created will also be cached and will be put in the same pool as the parent. If the insert touched any pre-existing partitions that were cached, a request to watch the associated cache directives will be submitted. This will result in an async table refresh once the cache request completes. Updates the lastDdlTime of the table if new partitions were created.
Definition at line 2261 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.analysis.TableName.getDb(), com.cloudera.impala.catalog.Table.getDb(), com.cloudera.impala.service.CatalogOpExecutor.getExistingTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.catalog.Table.getName(), com.cloudera.impala.catalog.Table.getNumClusteringCols(), com.cloudera.impala.service.CatalogOpExecutor.getPartValsFromName(), com.cloudera.impala.service.JniCatalog.getServiceId(), com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject(), com.cloudera.impala.analysis.TableName.toThrift(), com.cloudera.impala.service.CatalogOpExecutor.updateLastDdlTime(), and com.cloudera.impala.catalog.CatalogServiceCatalog.watchCacheDirs().
|
inline |
Sets the table parameter 'transient_lastDdlTime' to System.currentTimeMillis()/1000 in the given msTbl. 'transient_lastDdlTime' is guaranteed to be changed. If msClient is not null then this method applies alter_table() to update the Metastore. Otherwise, the caller is responsible for the final update.
Definition at line 2087 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.calculateDdlTime().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropPartition(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), and com.cloudera.impala.service.CatalogOpExecutor.updateCatalog().
|
inlineprivate |
Updates the row counts of the given Hive partitions and the total row count of the given Hive table based on the given update stats parameters. The partitions whose row counts have not changed are skipped. The modified partitions are returned in the modifiedParts parameter. Row counts for missing or new partitions as a result of concurrent table alterations are set to 0. Returns the number of partitions that were targeted for update (includes partitions whose row counts have not changed).
Definition at line 501 of file CatalogOpExecutor.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats().
|
inlineprivate |
Throws a CatalogException if the Sentry Service is not enabled.
Definition at line 2007 of file CatalogOpExecutor.java.
References com.cloudera.impala.service.CatalogOpExecutor.catalog_, and com.cloudera.impala.catalog.CatalogServiceCatalog.getSentryProxy().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.createDropRole(), com.cloudera.impala.service.CatalogOpExecutor.grantRevokeRoleGroup(), and com.cloudera.impala.service.CatalogOpExecutor.grantRevokeRolePrivilege().
|
private |
Definition at line 159 of file CatalogOpExecutor.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), com.cloudera.impala.service.CatalogOpExecutor.CatalogOpExecutor(), com.cloudera.impala.service.CatalogOpExecutor.createDatabase(), com.cloudera.impala.service.CatalogOpExecutor.createDataSource(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.service.CatalogOpExecutor.createTableLike(), com.cloudera.impala.service.CatalogOpExecutor.createView(), com.cloudera.impala.service.CatalogOpExecutor.updateCatalog(), and com.cloudera.impala.service.CatalogOpExecutor.verifySentryServiceEnabled().
|
staticprivate |
Definition at line 156 of file CatalogOpExecutor.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.bulkAlterPartitions(), com.cloudera.impala.service.CatalogOpExecutor.createDatabase(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.service.CatalogOpExecutor.dropColumnStats(), com.cloudera.impala.service.CatalogOpExecutor.dropDatabase(), and com.cloudera.impala.service.CatalogOpExecutor.dropTableOrView().
|
staticprivate |
Definition at line 165 of file CatalogOpExecutor.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.createDataSource(), and com.cloudera.impala.service.CatalogOpExecutor.dropDataSource().
|
staticprivate |
Definition at line 169 of file CatalogOpExecutor.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.bulkAlterPartitions().
|
private |
Definition at line 164 of file CatalogOpExecutor.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterPartitionSetCached(), com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableChangeCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetFileFormat(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetLocation(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetTblProperties(), com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats(), com.cloudera.impala.service.CatalogOpExecutor.alterView(), com.cloudera.impala.service.CatalogOpExecutor.bulkAlterPartitions(), com.cloudera.impala.service.CatalogOpExecutor.createDatabase(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.service.CatalogOpExecutor.dropColumnStats(), com.cloudera.impala.service.CatalogOpExecutor.dropDatabase(), com.cloudera.impala.service.CatalogOpExecutor.dropStats(), and com.cloudera.impala.service.CatalogOpExecutor.dropTableOrView().