public class HiveMetadata extends Object implements TransactionalMetadata
| Modifier and Type | Field and Description |
|---|---|
static String |
REFERENCED_MATERIALIZED_VIEWS |
static Set<String> |
RESERVED_ROLES |
| Constructor and Description |
|---|
HiveMetadata(SemiTransactionalHiveMetastore metastore,
HdfsEnvironment hdfsEnvironment,
HivePartitionManager partitionManager,
org.joda.time.DateTimeZone timeZone,
boolean allowCorruptWritesForTesting,
boolean writesToNonManagedTablesEnabled,
boolean createsOfNonManagedTablesEnabled,
int maxPartitionBatchSize,
TypeManager typeManager,
LocationService locationService,
StandardFunctionResolution functionResolution,
RowExpressionService rowExpressionService,
FilterStatsCalculatorService filterStatsCalculatorService,
TableParameterCodec tableParameterCodec,
com.facebook.airlift.json.JsonCodec<PartitionUpdate> partitionUpdateCodec,
com.facebook.airlift.json.smile.SmileCodec<PartitionUpdate> partitionUpdateSmileCodec,
TypeTranslator typeTranslator,
String prestoVersion,
HiveStatisticsProvider hiveStatisticsProvider,
StagingFileCommitter stagingFileCommitter,
ZeroRowFileCreator zeroRowFileCreator,
PartitionObjectBuilder partitionObjectBuilder,
HiveEncryptionInformationProvider encryptionInformationProvider,
HivePartitionStats hivePartitionStats,
HiveFileRenamer hiveFileRenamer) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbeginQuery, cleanupQuery, finishDelete, getMaterializedViewStatus, listTables, listViews, resolveIndex, schemaExists, truncateTablepublic static final String REFERENCED_MATERIALIZED_VIEWS
public HiveMetadata(SemiTransactionalHiveMetastore metastore, HdfsEnvironment hdfsEnvironment, HivePartitionManager partitionManager, org.joda.time.DateTimeZone timeZone, boolean allowCorruptWritesForTesting, boolean writesToNonManagedTablesEnabled, boolean createsOfNonManagedTablesEnabled, int maxPartitionBatchSize, TypeManager typeManager, LocationService locationService, StandardFunctionResolution functionResolution, RowExpressionService rowExpressionService, FilterStatsCalculatorService filterStatsCalculatorService, TableParameterCodec tableParameterCodec, com.facebook.airlift.json.JsonCodec<PartitionUpdate> partitionUpdateCodec, com.facebook.airlift.json.smile.SmileCodec<PartitionUpdate> partitionUpdateSmileCodec, TypeTranslator typeTranslator, String prestoVersion, HiveStatisticsProvider hiveStatisticsProvider, StagingFileCommitter stagingFileCommitter, ZeroRowFileCreator zeroRowFileCreator, PartitionObjectBuilder partitionObjectBuilder, HiveEncryptionInformationProvider encryptionInformationProvider, HivePartitionStats hivePartitionStats, HiveFileRenamer hiveFileRenamer)
public SemiTransactionalHiveMetastore getMetastore()
getMetastore in interface TransactionalMetadatapublic List<String> listSchemaNames(ConnectorSession session)
listSchemaNames in interface ConnectorMetadatapublic HiveTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)
getTableHandle in interface ConnectorMetadatapublic ConnectorTableHandle getTableHandleForStatisticsCollection(ConnectorSession session, SchemaTableName tableName, Map<String,Object> analyzeProperties)
getTableHandleForStatisticsCollection in interface ConnectorMetadatapublic Optional<SystemTable> getSystemTable(ConnectorSession session, SchemaTableName tableName)
getSystemTable in interface ConnectorMetadatapublic ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle tableHandle)
getTableMetadata in interface ConnectorMetadataprotected Optional<? extends TableEncryptionProperties> getTableEncryptionPropertiesFromHiveProperties(Map<String,String> parameters, HiveStorageFormat storageFormat)
public Optional<Object> getInfo(ConnectorTableLayoutHandle layoutHandle)
getInfo in interface ConnectorMetadatapublic List<SchemaTableName> listTables(ConnectorSession session, String schemaNameOrNull)
listTables in interface ConnectorMetadatapublic Map<String,ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle)
getColumnHandles in interface ConnectorMetadatapublic Map<SchemaTableName,List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix)
listTableColumns in interface ConnectorMetadatapublic TableStatistics getTableStatistics(ConnectorSession session, ConnectorTableHandle tableHandle, Optional<ConnectorTableLayoutHandle> tableLayoutHandle, List<ColumnHandle> columnHandles, Constraint<ColumnHandle> constraint)
getTableStatistics in interface ConnectorMetadatapublic ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle)
getColumnMetadata in interface ConnectorMetadatapublic TupleDomain<ColumnHandle> toExplainIOConstraints(ConnectorSession session, ConnectorTableHandle tableHandle, TupleDomain<ColumnHandle> constraints)
Only Hive partition columns that are used in IO planning.
toExplainIOConstraints in interface ConnectorMetadatapublic void createSchema(ConnectorSession session, String schemaName, Map<String,Object> properties)
createSchema in interface ConnectorMetadatapublic void dropSchema(ConnectorSession session, String schemaName)
dropSchema in interface ConnectorMetadatapublic void renameSchema(ConnectorSession session, String source, String target)
renameSchema in interface ConnectorMetadatapublic void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, boolean ignoreExisting)
createTable in interface ConnectorMetadatapublic ConnectorTableHandle createTemporaryTable(ConnectorSession session, List<ColumnMetadata> columns, Optional<ConnectorPartitioningMetadata> partitioningMetadata)
createTemporaryTable in interface ConnectorMetadatapublic void addColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnMetadata column)
addColumn in interface ConnectorMetadatapublic void renameColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle source, String target)
renameColumn in interface ConnectorMetadatapublic void dropColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle column)
dropColumn in interface ConnectorMetadatapublic void renameTable(ConnectorSession session, ConnectorTableHandle tableHandle, SchemaTableName newTableName)
renameTable in interface ConnectorMetadatapublic void dropTable(ConnectorSession session, ConnectorTableHandle tableHandle)
dropTable in interface ConnectorMetadatapublic ConnectorTableHandle beginStatisticsCollection(ConnectorSession session, ConnectorTableHandle tableHandle)
beginStatisticsCollection in interface ConnectorMetadatapublic void finishStatisticsCollection(ConnectorSession session, ConnectorTableHandle tableHandle, Collection<ComputedStatistics> computedStatistics)
finishStatisticsCollection in interface ConnectorMetadatapublic HiveOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorNewTableLayout> layout)
beginCreateTable in interface ConnectorMetadatapublic Optional<ConnectorOutputMetadata> finishCreateTable(ConnectorSession session, ConnectorOutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)
finishCreateTable in interface ConnectorMetadatapublic static boolean shouldCreateFilesForMissingBuckets(Table table, ConnectorSession session)
public HiveInsertTableHandle beginInsert(ConnectorSession session, ConnectorTableHandle tableHandle)
beginInsert in interface ConnectorMetadatapublic Optional<ConnectorOutputMetadata> finishInsert(ConnectorSession session, ConnectorInsertTableHandle insertHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)
finishInsert in interface ConnectorMetadatapublic void createView(ConnectorSession session, ConnectorTableMetadata viewMetadata, String viewData, boolean replace)
createView in interface ConnectorMetadatapublic void dropView(ConnectorSession session, SchemaTableName viewName)
dropView in interface ConnectorMetadatapublic List<SchemaTableName> listViews(ConnectorSession session, String schemaNameOrNull)
listViews in interface ConnectorMetadatapublic Map<SchemaTableName,ConnectorViewDefinition> getViews(ConnectorSession session, SchemaTablePrefix prefix)
getViews in interface ConnectorMetadatapublic Optional<MaterializedViewDefinition> getMaterializedView(ConnectorSession session, SchemaTableName viewName)
getMaterializedView in interface ConnectorMetadatapublic MaterializedViewStatus getMaterializedViewStatus(ConnectorSession session, SchemaTableName materializedViewName, TupleDomain<String> baseQueryDomain)
getMaterializedViewStatus in interface ConnectorMetadatapublic void createMaterializedView(ConnectorSession session, ConnectorTableMetadata viewMetadata, MaterializedViewDefinition viewDefinition, boolean ignoreExisting)
createMaterializedView in interface ConnectorMetadatapublic void dropMaterializedView(ConnectorSession session, SchemaTableName viewName)
dropMaterializedView in interface ConnectorMetadatapublic HiveInsertTableHandle beginRefreshMaterializedView(ConnectorSession session, ConnectorTableHandle tableHandle)
beginRefreshMaterializedView in interface ConnectorMetadatapublic Optional<ConnectorOutputMetadata> finishRefreshMaterializedView(ConnectorSession session, ConnectorInsertTableHandle insertHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)
finishRefreshMaterializedView in interface ConnectorMetadatapublic Optional<List<SchemaTableName>> getReferencedMaterializedViews(ConnectorSession session, SchemaTableName tableName)
getReferencedMaterializedViews in interface ConnectorMetadatapublic ConnectorTableHandle beginDelete(ConnectorSession session, ConnectorTableHandle tableHandle)
beginDelete in interface ConnectorMetadatapublic ColumnHandle getUpdateRowIdColumnHandle(ConnectorSession session, ConnectorTableHandle tableHandle)
getUpdateRowIdColumnHandle in interface ConnectorMetadatapublic OptionalLong metadataDelete(ConnectorSession session, ConnectorTableHandle tableHandle, ConnectorTableLayoutHandle tableLayoutHandle)
metadataDelete in interface ConnectorMetadatapublic boolean supportsMetadataDelete(ConnectorSession session, ConnectorTableHandle tableHandle, Optional<ConnectorTableLayoutHandle> tableLayoutHandle)
supportsMetadataDelete in interface ConnectorMetadatapublic boolean isLegacyGetLayoutSupported(ConnectorSession session, ConnectorTableHandle tableHandle)
isLegacyGetLayoutSupported in interface ConnectorMetadatapublic List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle tableHandle, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
getTableLayouts in interface ConnectorMetadatapublic ConnectorTableLayout getTableLayout(ConnectorSession session, ConnectorTableLayoutHandle layoutHandle)
getTableLayout in interface ConnectorMetadatapublic Optional<ConnectorPartitioningHandle> getCommonPartitioningHandle(ConnectorSession session, ConnectorPartitioningHandle left, ConnectorPartitioningHandle right)
getCommonPartitioningHandle in interface ConnectorMetadatapublic boolean isRefinedPartitioningOver(ConnectorSession session, ConnectorPartitioningHandle left, ConnectorPartitioningHandle right)
isRefinedPartitioningOver in interface ConnectorMetadatapublic ConnectorTableLayoutHandle getAlternativeLayoutHandle(ConnectorSession session, ConnectorTableLayoutHandle tableLayoutHandle, ConnectorPartitioningHandle partitioningHandle)
getAlternativeLayoutHandle in interface ConnectorMetadatapublic ConnectorPartitioningHandle getPartitioningHandleForExchange(ConnectorSession session, int partitionCount, List<Type> partitionTypes)
getPartitioningHandleForExchange in interface ConnectorMetadatapublic Optional<ConnectorNewTableLayout> getInsertLayout(ConnectorSession session, ConnectorTableHandle tableHandle)
getInsertLayout in interface ConnectorMetadatapublic Optional<ConnectorNewTableLayout> getPreferredShuffleLayoutForInsert(ConnectorSession session, ConnectorTableHandle tableHandle)
getPreferredShuffleLayoutForInsert in interface ConnectorMetadatapublic Optional<ConnectorNewTableLayout> getNewTableLayout(ConnectorSession session, ConnectorTableMetadata tableMetadata)
getNewTableLayout in interface ConnectorMetadatapublic Optional<ConnectorNewTableLayout> getPreferredShuffleLayoutForNewTable(ConnectorSession session, ConnectorTableMetadata tableMetadata)
getPreferredShuffleLayoutForNewTable in interface ConnectorMetadatapublic TableStatisticsMetadata getStatisticsCollectionMetadataForWrite(ConnectorSession session, ConnectorTableMetadata tableMetadata)
getStatisticsCollectionMetadataForWrite in interface ConnectorMetadatapublic TableStatisticsMetadata getStatisticsCollectionMetadata(ConnectorSession session, ConnectorTableMetadata tableMetadata)
getStatisticsCollectionMetadata in interface ConnectorMetadatapublic void createRole(ConnectorSession session, String role, Optional<PrestoPrincipal> grantor)
createRole in interface ConnectorMetadatapublic void dropRole(ConnectorSession session, String role)
dropRole in interface ConnectorMetadatapublic Set<String> listRoles(ConnectorSession session)
listRoles in interface ConnectorMetadatapublic Set<RoleGrant> listRoleGrants(ConnectorSession session, PrestoPrincipal principal)
listRoleGrants in interface ConnectorMetadatapublic void grantRoles(ConnectorSession session, Set<String> roles, Set<PrestoPrincipal> grantees, boolean withAdminOption, Optional<PrestoPrincipal> grantor)
grantRoles in interface ConnectorMetadatapublic void revokeRoles(ConnectorSession session, Set<String> roles, Set<PrestoPrincipal> grantees, boolean adminOptionFor, Optional<PrestoPrincipal> grantor)
revokeRoles in interface ConnectorMetadatapublic Set<RoleGrant> listApplicableRoles(ConnectorSession session, PrestoPrincipal principal)
listApplicableRoles in interface ConnectorMetadatapublic Set<String> listEnabledRoles(ConnectorSession session)
listEnabledRoles in interface ConnectorMetadatapublic void grantTablePrivileges(ConnectorSession session, SchemaTableName schemaTableName, Set<Privilege> privileges, PrestoPrincipal grantee, boolean grantOption)
grantTablePrivileges in interface ConnectorMetadatapublic void revokeTablePrivileges(ConnectorSession session, SchemaTableName schemaTableName, Set<Privilege> privileges, PrestoPrincipal grantee, boolean grantOption)
revokeTablePrivileges in interface ConnectorMetadatapublic List<GrantInfo> listTablePrivileges(ConnectorSession session, SchemaTablePrefix schemaTablePrefix)
listTablePrivileges in interface ConnectorMetadatapublic CompletableFuture<Void> commitPageSinkAsync(ConnectorSession session, ConnectorOutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)
commitPageSinkAsync in interface ConnectorMetadatapublic CompletableFuture<Void> commitPageSinkAsync(ConnectorSession session, ConnectorInsertTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)
commitPageSinkAsync in interface ConnectorMetadatapublic List<ConnectorMetadataUpdateHandle> getMetadataUpdateResults(List<ConnectorMetadataUpdateHandle> metadataUpdateRequests, QueryId queryId)
getMetadataUpdateResults in interface ConnectorMetadatapublic void doMetadataUpdateCleanup(QueryId queryId)
doMetadataUpdateCleanup in interface ConnectorMetadatapublic List<PartitionUpdate> getPartitionUpdates(ConnectorSession session, Collection<io.airlift.slice.Slice> fragments)
protected Optional<TableEncryptionProperties> getTableEncryptionPropertiesFromTableProperties(ConnectorTableMetadata tableMetadata, HiveStorageFormat hiveStorageFormat, List<String> partitionedBy)
public void rollback()
rollback in interface TransactionalMetadatapublic ConnectorCommitHandle commit()
commit in interface TransactionalMetadatapublic TableLayoutFilterCoverage getTableLayoutFilterCoverage(ConnectorTableLayoutHandle connectorTableLayoutHandle, Set<String> relevantPartitionColumns)
getTableLayoutFilterCoverage in interface ConnectorMetadatapublic static Optional<SchemaTableName> getSourceTableNameFromSystemTable(SchemaTableName tableName)
Copyright © 2012–2023. All rights reserved.