Package io.trino.metadata
Class MetadataManager
- java.lang.Object
-
- io.trino.metadata.MetadataManager
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_TABLE_REDIRECTIONS
-
Constructor Summary
Constructors Constructor Description MetadataManager(FeaturesConfig featuresConfig, SessionPropertyManager sessionPropertyManager, SchemaPropertyManager schemaPropertyManager, TablePropertyManager tablePropertyManager, MaterializedViewPropertyManager materializedViewPropertyManager, ColumnPropertyManager columnPropertyManager, AnalyzePropertyManager analyzePropertyManager, TableProceduresPropertyManager tableProceduresPropertyManager, SystemSecurityMetadata systemSecurityMetadata, TransactionManager transactionManager, TypeOperators typeOperators, BlockTypeOperators blockTypeOperators, NodeVersion nodeVersion)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBlockEncoding(BlockEncoding blockEncoding)voidaddColumn(Session session, TableHandle tableHandle, ColumnMetadata column)Add the specified column to the table.voidaddFunctions(List<? extends SqlFunction> functionInfos)voidaddParametricType(ParametricType parametricType)voidaddType(Type type)Optional<AggregationApplicationResult<TableHandle>>applyAggregation(Session session, TableHandle table, List<AggregateFunction> aggregations, Map<String,ColumnHandle> assignments, List<List<ColumnHandle>> groupingSets)Optional<TableHandle>applyDelete(Session session, TableHandle table)Push delete into connectorOptional<ConstraintApplicationResult<TableHandle>>applyFilter(Session session, TableHandle table, Constraint constraint)Optional<JoinApplicationResult<TableHandle>>applyJoin(Session session, JoinType joinType, TableHandle left, TableHandle right, List<JoinCondition> joinConditions, Map<String,ColumnHandle> leftAssignments, Map<String,ColumnHandle> rightAssignments, JoinStatistics statistics)Optional<LimitApplicationResult<TableHandle>>applyLimit(Session session, TableHandle table, long limit)Optional<ProjectionApplicationResult<TableHandle>>applyProjection(Session session, TableHandle table, List<ConnectorExpression> projections, Map<String,ColumnHandle> assignments)Optional<SampleApplicationResult<TableHandle>>applySample(Session session, TableHandle table, SampleType sampleType, double sampleRatio)Optional<TableScanRedirectApplicationResult>applyTableScanRedirect(Session session, TableHandle tableHandle)Returns the result of redirecting the table scan on a given table to a different table.Optional<TopNApplicationResult<TableHandle>>applyTopN(Session session, TableHandle table, long topNCount, List<SortItem> sortItems, Map<String,ColumnHandle> assignments)OutputTableHandlebeginCreateTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, Optional<NewTableLayout> layout)Begin the atomic creation of a table with data.TableHandlebeginDelete(Session session, TableHandle tableHandle)Begin delete queryInsertTableHandlebeginInsert(Session session, TableHandle tableHandle, List<ColumnHandle> columns)Begin insert queryInsertTableHandlebeginRefreshMaterializedView(Session session, TableHandle tableHandle, List<TableHandle> sourceTableHandles)Begin refresh materialized view queryAnalyzeTableHandlebeginStatisticsCollection(Session session, TableHandle tableHandle)Begin statistics collectionBeginTableExecuteResult<TableExecuteHandle,TableHandle>beginTableExecute(Session session, TableExecuteHandle tableExecuteHandle, TableHandle sourceHandle)TableHandlebeginUpdate(Session session, TableHandle tableHandle, List<ColumnHandle> updatedColumns)Begin update querybooleancatalogExists(Session session, String catalogName)voidcleanupQuery(Session session)Cleanup after a query.voidcreateMaterializedView(Session session, QualifiedObjectName viewName, MaterializedViewDefinition definition, boolean replace, boolean ignoreExisting)Creates the specified materialized view with the specified view definition.voidcreateRole(Session session, String role, Optional<TrinoPrincipal> grantor, Optional<String> catalog)Creates the specified role in the specified catalog.voidcreateSchema(Session session, CatalogSchemaName schema, Map<String,Object> properties, TrinoPrincipal principal)Creates a schema.voidcreateTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, boolean ignoreExisting)Creates a table using the specified table metadata.static MetadataManagercreateTestMetadataManager()static MetadataManagercreateTestMetadataManager(FeaturesConfig featuresConfig)static MetadataManagercreateTestMetadataManager(CatalogManager catalogManager)static MetadataManagercreateTestMetadataManager(CatalogManager catalogManager, FeaturesConfig featuresConfig)static MetadataManagercreateTestMetadataManager(TransactionManager transactionManager, FeaturesConfig featuresConfig)voidcreateView(Session session, QualifiedObjectName viewName, ViewDefinition definition, boolean replace)Creates the specified view with the specified view definition.ResolvedFunctiondecodeFunction(QualifiedName name)booleandelegateMaterializedViewRefreshToConnector(Session session, QualifiedObjectName viewName)Returns true if materialized view refresh should be delegated to connectorvoiddenySchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee)Deny the specified privilege to the specified principal on the specified schema.voiddenyTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee)Deny the specified privilege to the specified principal on the specified tablevoiddropColumn(Session session, TableHandle tableHandle, ColumnHandle column)Drop the specified column.voiddropMaterializedView(Session session, QualifiedObjectName viewName)Drops the specified materialized view.voiddropRole(Session session, String role, Optional<String> catalog)Drops the specified role in the specified catalog.voiddropSchema(Session session, CatalogSchemaName schema)Drops the specified schema.voiddropTable(Session session, TableHandle tableHandle)Drops the specified tablevoiddropView(Session session, QualifiedObjectName viewName)Drops the specified view.OptionalLongexecuteDelete(Session session, TableHandle table)Execute delete in connectorOptional<ConnectorOutputMetadata>finishCreateTable(Session session, OutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)Finish a table creation with data after the data is written.voidfinishDelete(Session session, TableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)Finish delete queryOptional<ConnectorOutputMetadata>finishInsert(Session session, InsertTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)Finish insert queryOptional<ConnectorOutputMetadata>finishRefreshMaterializedView(Session session, TableHandle tableHandle, InsertTableHandle insertHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics, List<TableHandle> sourceTableHandles)Finish refresh materialized view queryvoidfinishStatisticsCollection(Session session, AnalyzeTableHandle tableHandle, Collection<ComputedStatistics> computedStatistics)Finish statistics collectionvoidfinishTableExecute(Session session, TableExecuteHandle tableExecuteHandle, Collection<io.airlift.slice.Slice> fragments, List<Object> tableExecuteState)voidfinishUpdate(Session session, TableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)Finish update queryTypefromSqlType(String sqlType)Set<QueryId>getActiveQueryIds()InternalAggregationFunctiongetAggregateFunctionImplementation(ResolvedFunction resolvedFunction)AggregationFunctionMetadatagetAggregationFunctionMetadata(ResolvedFunction resolvedFunction)AnalyzePropertyManagergetAnalyzePropertyManager()BlockEncodingSerdegetBlockEncodingSerde()Optional<CatalogName>getCatalogHandle(Session session, String catalogName)Returns a connector id for the specified catalog name.Map<String,Catalog>getCatalogs(Session session)Gets all the loaded catalogsResolvedFunctiongetCoercion(Session session, OperatorType operatorType, Type fromType, Type toType)ResolvedFunctiongetCoercion(Session session, QualifiedName name, Type fromType, Type toType)Map<String,ColumnHandle>getColumnHandles(Session session, TableHandle tableHandle)Gets all of the columns on the specified table, or an empty map if the columns cannot be enumerated.ColumnMetadatagetColumnMetadata(Session session, TableHandle tableHandle, ColumnHandle columnHandle)Gets the metadata for the specified table column.ColumnPropertyManagergetColumnPropertyManager()Optional<PartitioningHandle>getCommonPartitioning(Session session, PartitioningHandle left, PartitioningHandle right)Return a partitioning handle which the connector can transparently convert bothleftandrightinto.Set<ConnectorCapabilities>getConnectorCapabilities(Session session, CatalogName catalogName)ColumnHandlegetDeleteRowIdColumnHandle(Session session, TableHandle tableHandle)Get the row ID column handle used with UpdatablePageSource#deleteRows.FunctionMetadatagetFunctionMetadata(ResolvedFunction resolvedFunction)Optional<Object>getInfo(Session session, TableHandle handle)Optional<NewTableLayout>getInsertLayout(Session session, TableHandle table)Optional<TableLayoutResult>getLayout(Session session, TableHandle table, Constraint constraint, Optional<Set<ColumnHandle>> desiredColumns)Optional<NewTableLayout>getLayoutForTableExecute(Session session, TableExecuteHandle tableExecuteHandle)Optional<MaterializedViewDefinition>getMaterializedView(Session session, QualifiedObjectName viewName)Returns the materialized view definition for the specified view name.MaterializedViewFreshnessgetMaterializedViewFreshness(Session session, QualifiedObjectName viewName)Method to get difference between the states of table at two different points in time/or as of given token-ids.MaterializedViewPropertyManagergetMaterializedViewPropertyManager()Map<QualifiedObjectName,ViewInfo>getMaterializedViews(Session session, QualifiedTablePrefix prefix)Get the materialized view definitions that match the specified table prefix (never null).Optional<NewTableLayout>getNewTableLayout(Session session, String catalogName, ConnectorTableMetadata tableMetadata)Collection<ParametricType>getParametricTypes()ProcedureRegistrygetProcedureRegistry()RedirectionAwareTableHandlegetRedirectionAwareTableHandle(Session session, QualifiedObjectName tableName)Get the target table handle after performing redirection.RedirectionAwareTableHandlegetRedirectionAwareTableHandle(Session session, QualifiedObjectName tableName, Optional<TableVersion> startVersion, Optional<TableVersion> endVersion)Get the target table handle after performing redirection with a table version.FunctionInvokergetScalarFunctionInvoker(ResolvedFunction resolvedFunction, InvocationConvention invocationConvention)Optional<TrinoPrincipal>getSchemaOwner(Session session, CatalogSchemaName schemaName)Gets the schema owner for the specified schema.Map<String,Object>getSchemaProperties(Session session, CatalogSchemaName schemaName)Gets the schema properties for the specified schema.SchemaPropertyManagergetSchemaPropertyManager()SessionPropertyManagergetSessionPropertyManager()TableStatisticsMetadatagetStatisticsCollectionMetadata(Session session, String catalogName, ConnectorTableMetadata tableMetadata)Describe statistics that must be collected during a statistics collectionTableStatisticsMetadatagetStatisticsCollectionMetadataForWrite(Session session, String catalogName, ConnectorTableMetadata tableMetadata)Describes statistics that must be collected during a write.Optional<SystemTable>getSystemTable(Session session, QualifiedObjectName tableName)Optional<TableHandle>getTableHandle(Session session, QualifiedObjectName table)Returns a table handle for the specified table name.Optional<TableHandle>getTableHandle(Session session, QualifiedObjectName table, Optional<TableVersion> startVersion, Optional<TableVersion> endVersion)Returns a table handle for the specified table name with a specified versionOptional<TableExecuteHandle>getTableHandleForExecute(Session session, TableHandle tableHandle, String procedure, Map<String,Object> executeProperties)Optional<TableHandle>getTableHandleForStatisticsCollection(Session session, QualifiedObjectName table, Map<String,Object> analyzeProperties)TableMetadatagetTableMetadata(Session session, TableHandle tableHandle)Return the metadata for the specified table handle.TableProceduresRegistrygetTableProcedureRegistry()TableProceduresPropertyManagergetTableProceduresPropertyManager()TablePropertiesgetTableProperties(Session session, TableHandle handle)TablePropertyManagergetTablePropertyManager()TableSchemagetTableSchema(Session session, TableHandle tableHandle)Return table schema definition for the specified table handle.TableStatisticsgetTableStatistics(Session session, TableHandle tableHandle, Constraint constraint)Return statistics for specified table for given filtering contraint.TypegetType(TypeId id)TypegetType(TypeSignature signature)Collection<Type>getTypes()ColumnHandlegetUpdateRowIdColumnHandle(Session session, TableHandle tableHandle, List<ColumnHandle> updatedColumns)Get the row ID column handle used with UpdatablePageSource#updateRows.Optional<ViewDefinition>getView(Session session, QualifiedObjectName viewName)Returns the view definition for the specified view name.Map<QualifiedObjectName,ViewInfo>getViews(Session session, QualifiedTablePrefix prefix)Get the view definitions that match the specified table prefix (never null).WindowFunctionSuppliergetWindowFunctionImplementation(ResolvedFunction resolvedFunction)voidgrantRoles(Session session, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, Optional<String> catalog)Grants the specified roles to the specified grantees in the specified catalogvoidgrantSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)Grants the specified privilege to the specified user on the specified schema.voidgrantTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)Grants the specified privilege to the specified user on the specified tablebooleanisAggregationFunction(QualifiedName name)Is the named function an aggregation function? This does not need type parameters because overloads between aggregation and other function types are not allowed.booleanisCatalogManagedSecurity(Session session, String catalog)Does the specified catalog manage security directly, or does it use system security management?booleanisMaterializedView(Session session, QualifiedObjectName viewName)Is the specified table a materialized view.booleanisValidTableVersion(Session session, QualifiedObjectName tableName, TableVersion version)Verifies that a version is valid for a given tablebooleanisView(Session session, QualifiedObjectName viewName)Is the specified table a view.Set<RoleGrant>listAllRoleGrants(Session session, Optional<String> catalog, Optional<Set<String>> roles, Optional<Set<String>> grantees, OptionalLong limit)List all role grants in the specified catalog, optionally filtered by passed role, grantee, and limit predicates.Set<RoleGrant>listApplicableRoles(Session session, TrinoPrincipal principal, Optional<String> catalog)List applicable roles, including the transitive grants, for the specified principalSet<String>listEnabledRoles(Session session, String catalog)List applicable roles, including the transitive grants, in given catalogSet<String>listEnabledRoles(Identity identity)List applicable system roles, including the transitive grants, for the given identity.List<FunctionMetadata>listFunctions()List<QualifiedObjectName>listMaterializedViews(Session session, QualifiedTablePrefix prefix)Get the names that match the specified table prefix (never null).Set<RoleGrant>listRoleGrants(Session session, Optional<String> catalog, TrinoPrincipal principal)List roles grants in the specified catalog for a given principal, not recursively.Set<String>listRoles(Session session, Optional<String> catalog)List available roles in specified catalog.List<String>listSchemaNames(Session session, String catalogName)Map<CatalogName,List<TableColumnsMetadata>>listTableColumns(Session session, QualifiedTablePrefix prefix)Gets the columns metadata for all tables that match the specified prefix.List<GrantInfo>listTablePrivileges(Session session, QualifiedTablePrefix prefix)Gets the privileges for the specified table available to the given grantee considering the selected session roleList<QualifiedObjectName>listTables(Session session, QualifiedTablePrefix prefix)Get the names that match the specified table prefix (never null).List<QualifiedObjectName>listViews(Session session, QualifiedTablePrefix prefix)Get the names that match the specified table prefix (never null).TableHandlemakeCompatiblePartitioning(Session session, TableHandle tableHandle, PartitioningHandle partitioningHandle)Return a table handle whose partitioning is converted to the provided partitioning handle, but otherwise identical to the provided table handle.com.google.common.util.concurrent.ListenableFuture<Void>refreshMaterializedView(Session session, QualifiedObjectName viewName)Refresh materialized viewvoidrenameColumn(Session session, TableHandle tableHandle, ColumnHandle source, String target)Rename the specified column.voidrenameMaterializedView(Session session, QualifiedObjectName source, QualifiedObjectName target)Rename the specified materialized view.voidrenameSchema(Session session, CatalogSchemaName source, String target)Renames the specified schema.voidrenameTable(Session session, TableHandle tableHandle, QualifiedObjectName newTableName)Rename the specified table.voidrenameView(Session session, QualifiedObjectName source, QualifiedObjectName target)Rename the specified view.ResolvedFunctionresolve(Session session, FunctionBinding functionBinding, FunctionMetadata functionMetadata, FunctionDependencyDeclaration declaration)ResolvedFunctionresolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)Optional<ResolvedIndex>resolveIndex(Session session, TableHandle tableHandle, Set<ColumnHandle> indexableColumns, Set<ColumnHandle> outputColumns, TupleDomain<ColumnHandle> tupleDomain)Try to locate a table index that can lookup results by indexableColumns and provide the requested outputColumns.ResolvedFunctionresolveOperator(Session session, OperatorType operatorType, List<? extends Type> argumentTypes)voidrevokeRoles(Session session, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, Optional<String> catalog)Revokes the specified roles from the specified grantees in the specified catalogvoidrevokeSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)Revokes the specified privilege on the specified schema from the specified user.voidrevokeTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)Revokes the specified privilege on the specified table from the specified userbooleanroleExists(Session session, String role, Optional<String> catalog)Does the specified role exist.booleanschemaExists(Session session, CatalogSchemaName schema)voidsetColumnComment(Session session, TableHandle tableHandle, ColumnHandle column, Optional<String> comment)Comments to the specified column.voidsetSchemaAuthorization(Session session, CatalogSchemaName source, TrinoPrincipal principal)Set the specified schema's user/role.voidsetTableAuthorization(Session session, CatalogSchemaTableName table, TrinoPrincipal principal)Set the authorization (owner) of specified table's user/rolevoidsetTableComment(Session session, TableHandle tableHandle, Optional<String> comment)Comments to the specified table.voidsetTableProperties(Session session, TableHandle tableHandle, Map<String,Object> properties)Set properties to the specified table.voidsetViewAuthorization(Session session, CatalogSchemaTableName view, TrinoPrincipal principal)Set the authorization (owner) of specified view's user/rolebooleansupportsMetadataDelete(Session session, TableHandle tableHandle)booleansupportsMissingColumnsOnInsert(Session session, TableHandle tableHandle)static FunctionBindingtoFunctionBinding(FunctionId functionId, BoundSignature boundSignature, Signature functionSignature)voidtruncateTable(Session session, TableHandle tableHandle)Truncates the specified tablebooleanusesLegacyTableLayouts(Session session, TableHandle table)voidvalidateScan(Session session, TableHandle table)voidverifyTypes()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.trino.metadata.Metadata
getCoercion, getParameterizedType
-
-
-
-
Field Detail
-
MAX_TABLE_REDIRECTIONS
public static final int MAX_TABLE_REDIRECTIONS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MetadataManager
@Inject public MetadataManager(FeaturesConfig featuresConfig, SessionPropertyManager sessionPropertyManager, SchemaPropertyManager schemaPropertyManager, TablePropertyManager tablePropertyManager, MaterializedViewPropertyManager materializedViewPropertyManager, ColumnPropertyManager columnPropertyManager, AnalyzePropertyManager analyzePropertyManager, TableProceduresPropertyManager tableProceduresPropertyManager, SystemSecurityMetadata systemSecurityMetadata, TransactionManager transactionManager, TypeOperators typeOperators, BlockTypeOperators blockTypeOperators, NodeVersion nodeVersion)
-
-
Method Detail
-
createTestMetadataManager
public static MetadataManager createTestMetadataManager()
-
createTestMetadataManager
public static MetadataManager createTestMetadataManager(FeaturesConfig featuresConfig)
-
createTestMetadataManager
public static MetadataManager createTestMetadataManager(CatalogManager catalogManager)
-
createTestMetadataManager
public static MetadataManager createTestMetadataManager(CatalogManager catalogManager, FeaturesConfig featuresConfig)
-
createTestMetadataManager
public static MetadataManager createTestMetadataManager(TransactionManager transactionManager, FeaturesConfig featuresConfig)
-
getConnectorCapabilities
public Set<ConnectorCapabilities> getConnectorCapabilities(Session session, CatalogName catalogName)
- Specified by:
getConnectorCapabilitiesin interfaceMetadata
-
catalogExists
public boolean catalogExists(Session session, String catalogName)
- Specified by:
catalogExistsin interfaceMetadata
-
schemaExists
public boolean schemaExists(Session session, CatalogSchemaName schema)
- Specified by:
schemaExistsin interfaceMetadata
-
listSchemaNames
public List<String> listSchemaNames(Session session, String catalogName)
- Specified by:
listSchemaNamesin interfaceMetadata
-
getTableHandle
public Optional<TableHandle> getTableHandle(Session session, QualifiedObjectName table)
Description copied from interface:MetadataReturns a table handle for the specified table name.- Specified by:
getTableHandlein interfaceMetadata
-
getTableHandle
public Optional<TableHandle> getTableHandle(Session session, QualifiedObjectName table, Optional<TableVersion> startVersion, Optional<TableVersion> endVersion)
Description copied from interface:MetadataReturns a table handle for the specified table name with a specified version- Specified by:
getTableHandlein interfaceMetadata
-
getTableHandleForStatisticsCollection
public Optional<TableHandle> getTableHandleForStatisticsCollection(Session session, QualifiedObjectName table, Map<String,Object> analyzeProperties)
- Specified by:
getTableHandleForStatisticsCollectionin interfaceMetadata
-
getTableHandleForExecute
public Optional<TableExecuteHandle> getTableHandleForExecute(Session session, TableHandle tableHandle, String procedure, Map<String,Object> executeProperties)
- Specified by:
getTableHandleForExecutein interfaceMetadata
-
getLayoutForTableExecute
public Optional<NewTableLayout> getLayoutForTableExecute(Session session, TableExecuteHandle tableExecuteHandle)
- Specified by:
getLayoutForTableExecutein interfaceMetadata
-
beginTableExecute
public BeginTableExecuteResult<TableExecuteHandle,TableHandle> beginTableExecute(Session session, TableExecuteHandle tableExecuteHandle, TableHandle sourceHandle)
- Specified by:
beginTableExecutein interfaceMetadata
-
finishTableExecute
public void finishTableExecute(Session session, TableExecuteHandle tableExecuteHandle, Collection<io.airlift.slice.Slice> fragments, List<Object> tableExecuteState)
- Specified by:
finishTableExecutein interfaceMetadata
-
getSystemTable
public Optional<SystemTable> getSystemTable(Session session, QualifiedObjectName tableName)
- Specified by:
getSystemTablein interfaceMetadata
-
getLayout
public Optional<TableLayoutResult> getLayout(Session session, TableHandle table, Constraint constraint, Optional<Set<ColumnHandle>> desiredColumns)
-
getTableProperties
public TableProperties getTableProperties(Session session, TableHandle handle)
- Specified by:
getTablePropertiesin interfaceMetadata
-
makeCompatiblePartitioning
public TableHandle makeCompatiblePartitioning(Session session, TableHandle tableHandle, PartitioningHandle partitioningHandle)
Description copied from interface:MetadataReturn a table handle whose partitioning is converted to the provided partitioning handle, but otherwise identical to the provided table handle. The provided table handle must be one that the connector can transparently convert to from the original partitioning handle associated with the provided table handle, as promised byMetadata.getCommonPartitioning(io.trino.Session, io.trino.sql.planner.PartitioningHandle, io.trino.sql.planner.PartitioningHandle).- Specified by:
makeCompatiblePartitioningin interfaceMetadata
-
getCommonPartitioning
public Optional<PartitioningHandle> getCommonPartitioning(Session session, PartitioningHandle left, PartitioningHandle right)
Description copied from interface:MetadataReturn a partitioning handle which the connector can transparently convert bothleftandrightinto.- Specified by:
getCommonPartitioningin interfaceMetadata
-
getInfo
public Optional<Object> getInfo(Session session, TableHandle handle)
-
getTableSchema
public TableSchema getTableSchema(Session session, TableHandle tableHandle)
Description copied from interface:MetadataReturn table schema definition for the specified table handle. Table schema definition is a set of information required by semantic analyzer to analyze the query.- Specified by:
getTableSchemain interfaceMetadata
-
getTableMetadata
public TableMetadata getTableMetadata(Session session, TableHandle tableHandle)
Description copied from interface:MetadataReturn the metadata for the specified table handle.- Specified by:
getTableMetadatain interfaceMetadata
-
getTableStatistics
public TableStatistics getTableStatistics(Session session, TableHandle tableHandle, Constraint constraint)
Description copied from interface:MetadataReturn statistics for specified table for given filtering contraint.- Specified by:
getTableStatisticsin interfaceMetadata
-
getColumnHandles
public Map<String,ColumnHandle> getColumnHandles(Session session, TableHandle tableHandle)
Description copied from interface:MetadataGets all of the columns on the specified table, or an empty map if the columns cannot be enumerated.- Specified by:
getColumnHandlesin interfaceMetadata
-
getColumnMetadata
public ColumnMetadata getColumnMetadata(Session session, TableHandle tableHandle, ColumnHandle columnHandle)
Description copied from interface:MetadataGets the metadata for the specified table column.- Specified by:
getColumnMetadatain interfaceMetadata
-
listTables
public List<QualifiedObjectName> listTables(Session session, QualifiedTablePrefix prefix)
Description copied from interface:MetadataGet the names that match the specified table prefix (never null).- Specified by:
listTablesin interfaceMetadata
-
listTableColumns
public Map<CatalogName,List<TableColumnsMetadata>> listTableColumns(Session session, QualifiedTablePrefix prefix)
Description copied from interface:MetadataGets the columns metadata for all tables that match the specified prefix. TODO: consider returning a stream for more efficient processing- Specified by:
listTableColumnsin interfaceMetadata
-
createSchema
public void createSchema(Session session, CatalogSchemaName schema, Map<String,Object> properties, TrinoPrincipal principal)
Description copied from interface:MetadataCreates a schema.- Specified by:
createSchemain interfaceMetadataprincipal- TODO
-
dropSchema
public void dropSchema(Session session, CatalogSchemaName schema)
Description copied from interface:MetadataDrops the specified schema.- Specified by:
dropSchemain interfaceMetadata
-
renameSchema
public void renameSchema(Session session, CatalogSchemaName source, String target)
Description copied from interface:MetadataRenames the specified schema.- Specified by:
renameSchemain interfaceMetadata
-
setSchemaAuthorization
public void setSchemaAuthorization(Session session, CatalogSchemaName source, TrinoPrincipal principal)
Description copied from interface:MetadataSet the specified schema's user/role.- Specified by:
setSchemaAuthorizationin interfaceMetadata
-
createTable
public void createTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, boolean ignoreExisting)
Description copied from interface:MetadataCreates a table using the specified table metadata.- Specified by:
createTablein interfaceMetadata
-
renameTable
public void renameTable(Session session, TableHandle tableHandle, QualifiedObjectName newTableName)
Description copied from interface:MetadataRename the specified table.- Specified by:
renameTablein interfaceMetadata
-
setTableProperties
public void setTableProperties(Session session, TableHandle tableHandle, Map<String,Object> properties)
Description copied from interface:MetadataSet properties to the specified table.- Specified by:
setTablePropertiesin interfaceMetadata
-
setTableComment
public void setTableComment(Session session, TableHandle tableHandle, Optional<String> comment)
Description copied from interface:MetadataComments to the specified table.- Specified by:
setTableCommentin interfaceMetadata
-
setColumnComment
public void setColumnComment(Session session, TableHandle tableHandle, ColumnHandle column, Optional<String> comment)
Description copied from interface:MetadataComments to the specified column.- Specified by:
setColumnCommentin interfaceMetadata
-
renameColumn
public void renameColumn(Session session, TableHandle tableHandle, ColumnHandle source, String target)
Description copied from interface:MetadataRename the specified column.- Specified by:
renameColumnin interfaceMetadata
-
addColumn
public void addColumn(Session session, TableHandle tableHandle, ColumnMetadata column)
Description copied from interface:MetadataAdd the specified column to the table.
-
dropColumn
public void dropColumn(Session session, TableHandle tableHandle, ColumnHandle column)
Description copied from interface:MetadataDrop the specified column.- Specified by:
dropColumnin interfaceMetadata
-
setTableAuthorization
public void setTableAuthorization(Session session, CatalogSchemaTableName table, TrinoPrincipal principal)
Description copied from interface:MetadataSet the authorization (owner) of specified table's user/role- Specified by:
setTableAuthorizationin interfaceMetadata
-
dropTable
public void dropTable(Session session, TableHandle tableHandle)
Description copied from interface:MetadataDrops the specified table
-
truncateTable
public void truncateTable(Session session, TableHandle tableHandle)
Description copied from interface:MetadataTruncates the specified table- Specified by:
truncateTablein interfaceMetadata
-
getInsertLayout
public Optional<NewTableLayout> getInsertLayout(Session session, TableHandle table)
- Specified by:
getInsertLayoutin interfaceMetadata
-
getStatisticsCollectionMetadataForWrite
public TableStatisticsMetadata getStatisticsCollectionMetadataForWrite(Session session, String catalogName, ConnectorTableMetadata tableMetadata)
Description copied from interface:MetadataDescribes statistics that must be collected during a write.- Specified by:
getStatisticsCollectionMetadataForWritein interfaceMetadata
-
getStatisticsCollectionMetadata
public TableStatisticsMetadata getStatisticsCollectionMetadata(Session session, String catalogName, ConnectorTableMetadata tableMetadata)
Description copied from interface:MetadataDescribe statistics that must be collected during a statistics collection- Specified by:
getStatisticsCollectionMetadatain interfaceMetadata
-
beginStatisticsCollection
public AnalyzeTableHandle beginStatisticsCollection(Session session, TableHandle tableHandle)
Description copied from interface:MetadataBegin statistics collection- Specified by:
beginStatisticsCollectionin interfaceMetadata
-
finishStatisticsCollection
public void finishStatisticsCollection(Session session, AnalyzeTableHandle tableHandle, Collection<ComputedStatistics> computedStatistics)
Description copied from interface:MetadataFinish statistics collection- Specified by:
finishStatisticsCollectionin interfaceMetadata
-
getNewTableLayout
public Optional<NewTableLayout> getNewTableLayout(Session session, String catalogName, ConnectorTableMetadata tableMetadata)
- Specified by:
getNewTableLayoutin interfaceMetadata
-
cleanupQuery
public void cleanupQuery(Session session)
Description copied from interface:MetadataCleanup after a query. This is the very last notification after the query finishes, regardless if it succeeds or fails. An exception thrown in this method will not affect the result of the query.- Specified by:
cleanupQueryin interfaceMetadata
-
beginCreateTable
public OutputTableHandle beginCreateTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, Optional<NewTableLayout> layout)
Description copied from interface:MetadataBegin the atomic creation of a table with data.- Specified by:
beginCreateTablein interfaceMetadata
-
finishCreateTable
public Optional<ConnectorOutputMetadata> finishCreateTable(Session session, OutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)
Description copied from interface:MetadataFinish a table creation with data after the data is written.- Specified by:
finishCreateTablein interfaceMetadata
-
beginInsert
public InsertTableHandle beginInsert(Session session, TableHandle tableHandle, List<ColumnHandle> columns)
Description copied from interface:MetadataBegin insert query- Specified by:
beginInsertin interfaceMetadata
-
supportsMissingColumnsOnInsert
public boolean supportsMissingColumnsOnInsert(Session session, TableHandle tableHandle)
- Specified by:
supportsMissingColumnsOnInsertin interfaceMetadata- Returns:
- whether connector handles missing columns during insert
-
finishInsert
public Optional<ConnectorOutputMetadata> finishInsert(Session session, InsertTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)
Description copied from interface:MetadataFinish insert query- Specified by:
finishInsertin interfaceMetadata
-
delegateMaterializedViewRefreshToConnector
public boolean delegateMaterializedViewRefreshToConnector(Session session, QualifiedObjectName viewName)
Description copied from interface:MetadataReturns true if materialized view refresh should be delegated to connector- Specified by:
delegateMaterializedViewRefreshToConnectorin interfaceMetadata
-
refreshMaterializedView
public com.google.common.util.concurrent.ListenableFuture<Void> refreshMaterializedView(Session session, QualifiedObjectName viewName)
Description copied from interface:MetadataRefresh materialized view- Specified by:
refreshMaterializedViewin interfaceMetadata
-
beginRefreshMaterializedView
public InsertTableHandle beginRefreshMaterializedView(Session session, TableHandle tableHandle, List<TableHandle> sourceTableHandles)
Description copied from interface:MetadataBegin refresh materialized view query- Specified by:
beginRefreshMaterializedViewin interfaceMetadata
-
finishRefreshMaterializedView
public Optional<ConnectorOutputMetadata> finishRefreshMaterializedView(Session session, TableHandle tableHandle, InsertTableHandle insertHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics, List<TableHandle> sourceTableHandles)
Description copied from interface:MetadataFinish refresh materialized view query- Specified by:
finishRefreshMaterializedViewin interfaceMetadata
-
getDeleteRowIdColumnHandle
public ColumnHandle getDeleteRowIdColumnHandle(Session session, TableHandle tableHandle)
Description copied from interface:MetadataGet the row ID column handle used with UpdatablePageSource#deleteRows.- Specified by:
getDeleteRowIdColumnHandlein interfaceMetadata
-
getUpdateRowIdColumnHandle
public ColumnHandle getUpdateRowIdColumnHandle(Session session, TableHandle tableHandle, List<ColumnHandle> updatedColumns)
Description copied from interface:MetadataGet the row ID column handle used with UpdatablePageSource#updateRows.- Specified by:
getUpdateRowIdColumnHandlein interfaceMetadata
-
supportsMetadataDelete
public boolean supportsMetadataDelete(Session session, TableHandle tableHandle)
- Specified by:
supportsMetadataDeletein interfaceMetadata- Returns:
- whether delete without table scan is supported
-
applyDelete
public Optional<TableHandle> applyDelete(Session session, TableHandle table)
Description copied from interface:MetadataPush delete into connector- Specified by:
applyDeletein interfaceMetadata
-
executeDelete
public OptionalLong executeDelete(Session session, TableHandle table)
Description copied from interface:MetadataExecute delete in connector- Specified by:
executeDeletein interfaceMetadata
-
beginDelete
public TableHandle beginDelete(Session session, TableHandle tableHandle)
Description copied from interface:MetadataBegin delete query- Specified by:
beginDeletein interfaceMetadata
-
finishDelete
public void finishDelete(Session session, TableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)
Description copied from interface:MetadataFinish delete query- Specified by:
finishDeletein interfaceMetadata
-
beginUpdate
public TableHandle beginUpdate(Session session, TableHandle tableHandle, List<ColumnHandle> updatedColumns)
Description copied from interface:MetadataBegin update query- Specified by:
beginUpdatein interfaceMetadata
-
finishUpdate
public void finishUpdate(Session session, TableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)
Description copied from interface:MetadataFinish update query- Specified by:
finishUpdatein interfaceMetadata
-
getCatalogHandle
public Optional<CatalogName> getCatalogHandle(Session session, String catalogName)
Description copied from interface:MetadataReturns a connector id for the specified catalog name.- Specified by:
getCatalogHandlein interfaceMetadata
-
getCatalogs
public Map<String,Catalog> getCatalogs(Session session)
Description copied from interface:MetadataGets all the loaded catalogs- Specified by:
getCatalogsin interfaceMetadata- Returns:
- Map of catalog name to connector
-
listViews
public List<QualifiedObjectName> listViews(Session session, QualifiedTablePrefix prefix)
Description copied from interface:MetadataGet the names that match the specified table prefix (never null).
-
getViews
public Map<QualifiedObjectName,ViewInfo> getViews(Session session, QualifiedTablePrefix prefix)
Description copied from interface:MetadataGet the view definitions that match the specified table prefix (never null).
-
getSchemaProperties
public Map<String,Object> getSchemaProperties(Session session, CatalogSchemaName schemaName)
Description copied from interface:MetadataGets the schema properties for the specified schema.- Specified by:
getSchemaPropertiesin interfaceMetadata
-
getSchemaOwner
public Optional<TrinoPrincipal> getSchemaOwner(Session session, CatalogSchemaName schemaName)
Description copied from interface:MetadataGets the schema owner for the specified schema.- Specified by:
getSchemaOwnerin interfaceMetadata
-
isView
public boolean isView(Session session, QualifiedObjectName viewName)
Description copied from interface:MetadataIs the specified table a view.
-
getView
public Optional<ViewDefinition> getView(Session session, QualifiedObjectName viewName)
Description copied from interface:MetadataReturns the view definition for the specified view name.
-
createView
public void createView(Session session, QualifiedObjectName viewName, ViewDefinition definition, boolean replace)
Description copied from interface:MetadataCreates the specified view with the specified view definition.- Specified by:
createViewin interfaceMetadata
-
renameView
public void renameView(Session session, QualifiedObjectName source, QualifiedObjectName target)
Description copied from interface:MetadataRename the specified view.- Specified by:
renameViewin interfaceMetadata
-
setViewAuthorization
public void setViewAuthorization(Session session, CatalogSchemaTableName view, TrinoPrincipal principal)
Description copied from interface:MetadataSet the authorization (owner) of specified view's user/role- Specified by:
setViewAuthorizationin interfaceMetadata
-
dropView
public void dropView(Session session, QualifiedObjectName viewName)
Description copied from interface:MetadataDrops the specified view.
-
createMaterializedView
public void createMaterializedView(Session session, QualifiedObjectName viewName, MaterializedViewDefinition definition, boolean replace, boolean ignoreExisting)
Description copied from interface:MetadataCreates the specified materialized view with the specified view definition.- Specified by:
createMaterializedViewin interfaceMetadata
-
dropMaterializedView
public void dropMaterializedView(Session session, QualifiedObjectName viewName)
Description copied from interface:MetadataDrops the specified materialized view.- Specified by:
dropMaterializedViewin interfaceMetadata
-
listMaterializedViews
public List<QualifiedObjectName> listMaterializedViews(Session session, QualifiedTablePrefix prefix)
Description copied from interface:MetadataGet the names that match the specified table prefix (never null).- Specified by:
listMaterializedViewsin interfaceMetadata
-
getMaterializedViews
public Map<QualifiedObjectName,ViewInfo> getMaterializedViews(Session session, QualifiedTablePrefix prefix)
Description copied from interface:MetadataGet the materialized view definitions that match the specified table prefix (never null).- Specified by:
getMaterializedViewsin interfaceMetadata
-
isMaterializedView
public boolean isMaterializedView(Session session, QualifiedObjectName viewName)
Description copied from interface:MetadataIs the specified table a materialized view.- Specified by:
isMaterializedViewin interfaceMetadata
-
getMaterializedView
public Optional<MaterializedViewDefinition> getMaterializedView(Session session, QualifiedObjectName viewName)
Description copied from interface:MetadataReturns the materialized view definition for the specified view name.- Specified by:
getMaterializedViewin interfaceMetadata
-
getMaterializedViewFreshness
public MaterializedViewFreshness getMaterializedViewFreshness(Session session, QualifiedObjectName viewName)
Description copied from interface:MetadataMethod to get difference between the states of table at two different points in time/or as of given token-ids. The method is used by the engine to determine if a materialized view is current with respect to the tables it depends on.- Specified by:
getMaterializedViewFreshnessin interfaceMetadata
-
renameMaterializedView
public void renameMaterializedView(Session session, QualifiedObjectName source, QualifiedObjectName target)
Description copied from interface:MetadataRename the specified materialized view.- Specified by:
renameMaterializedViewin interfaceMetadata
-
applyTableScanRedirect
public Optional<TableScanRedirectApplicationResult> applyTableScanRedirect(Session session, TableHandle tableHandle)
Description copied from interface:MetadataReturns the result of redirecting the table scan on a given table to a different table. This method is used by the engine during the plan optimization phase to allow a connector to offload table scans to any other connector. This method is called after security checks against the original table.- Specified by:
applyTableScanRedirectin interfaceMetadata
-
getRedirectionAwareTableHandle
public RedirectionAwareTableHandle getRedirectionAwareTableHandle(Session session, QualifiedObjectName tableName)
Description copied from interface:MetadataGet the target table handle after performing redirection.- Specified by:
getRedirectionAwareTableHandlein interfaceMetadata
-
getRedirectionAwareTableHandle
public RedirectionAwareTableHandle getRedirectionAwareTableHandle(Session session, QualifiedObjectName tableName, Optional<TableVersion> startVersion, Optional<TableVersion> endVersion)
Description copied from interface:MetadataGet the target table handle after performing redirection with a table version.- Specified by:
getRedirectionAwareTableHandlein interfaceMetadata
-
resolveIndex
public Optional<ResolvedIndex> resolveIndex(Session session, TableHandle tableHandle, Set<ColumnHandle> indexableColumns, Set<ColumnHandle> outputColumns, TupleDomain<ColumnHandle> tupleDomain)
Description copied from interface:MetadataTry to locate a table index that can lookup results by indexableColumns and provide the requested outputColumns.- Specified by:
resolveIndexin interfaceMetadata
-
usesLegacyTableLayouts
public boolean usesLegacyTableLayouts(Session session, TableHandle table)
- Specified by:
usesLegacyTableLayoutsin interfaceMetadata
-
applyLimit
public Optional<LimitApplicationResult<TableHandle>> applyLimit(Session session, TableHandle table, long limit)
- Specified by:
applyLimitin interfaceMetadata
-
applySample
public Optional<SampleApplicationResult<TableHandle>> applySample(Session session, TableHandle table, SampleType sampleType, double sampleRatio)
- Specified by:
applySamplein interfaceMetadata
-
applyAggregation
public Optional<AggregationApplicationResult<TableHandle>> applyAggregation(Session session, TableHandle table, List<AggregateFunction> aggregations, Map<String,ColumnHandle> assignments, List<List<ColumnHandle>> groupingSets)
- Specified by:
applyAggregationin interfaceMetadata
-
applyJoin
public Optional<JoinApplicationResult<TableHandle>> applyJoin(Session session, JoinType joinType, TableHandle left, TableHandle right, List<JoinCondition> joinConditions, Map<String,ColumnHandle> leftAssignments, Map<String,ColumnHandle> rightAssignments, JoinStatistics statistics)
-
applyTopN
public Optional<TopNApplicationResult<TableHandle>> applyTopN(Session session, TableHandle table, long topNCount, List<SortItem> sortItems, Map<String,ColumnHandle> assignments)
-
validateScan
public void validateScan(Session session, TableHandle table)
- Specified by:
validateScanin interfaceMetadata
-
applyFilter
public Optional<ConstraintApplicationResult<TableHandle>> applyFilter(Session session, TableHandle table, Constraint constraint)
- Specified by:
applyFilterin interfaceMetadata
-
applyProjection
public Optional<ProjectionApplicationResult<TableHandle>> applyProjection(Session session, TableHandle table, List<ConnectorExpression> projections, Map<String,ColumnHandle> assignments)
- Specified by:
applyProjectionin interfaceMetadata
-
isCatalogManagedSecurity
public boolean isCatalogManagedSecurity(Session session, String catalog)
Description copied from interface:MetadataDoes the specified catalog manage security directly, or does it use system security management?- Specified by:
isCatalogManagedSecurityin interfaceMetadata
-
roleExists
public boolean roleExists(Session session, String role, Optional<String> catalog)
Description copied from interface:MetadataDoes the specified role exist.- Specified by:
roleExistsin interfaceMetadatacatalog- if present, the role catalog; otherwise the role is a system role
-
createRole
public void createRole(Session session, String role, Optional<TrinoPrincipal> grantor, Optional<String> catalog)
Description copied from interface:MetadataCreates the specified role in the specified catalog.- Specified by:
createRolein interfaceMetadatagrantor- represents the principal specified by WITH ADMIN statementcatalog- if present, the role catalog; otherwise the role is a system role
-
dropRole
public void dropRole(Session session, String role, Optional<String> catalog)
Description copied from interface:MetadataDrops the specified role in the specified catalog.
-
listRoles
public Set<String> listRoles(Session session, Optional<String> catalog)
Description copied from interface:MetadataList available roles in specified catalog.
-
listAllRoleGrants
public Set<RoleGrant> listAllRoleGrants(Session session, Optional<String> catalog, Optional<Set<String>> roles, Optional<Set<String>> grantees, OptionalLong limit)
Description copied from interface:MetadataList all role grants in the specified catalog, optionally filtered by passed role, grantee, and limit predicates.- Specified by:
listAllRoleGrantsin interfaceMetadatacatalog- if present, the role catalog; otherwise the role is a system role
-
listRoleGrants
public Set<RoleGrant> listRoleGrants(Session session, Optional<String> catalog, TrinoPrincipal principal)
Description copied from interface:MetadataList roles grants in the specified catalog for a given principal, not recursively.- Specified by:
listRoleGrantsin interfaceMetadatacatalog- if present, the role catalog; otherwise the role is a system role
-
grantRoles
public void grantRoles(Session session, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, Optional<String> catalog)
Description copied from interface:MetadataGrants the specified roles to the specified grantees in the specified catalog- Specified by:
grantRolesin interfaceMetadatagrantor- represents the principal specified by GRANTED BY statementcatalog- if present, the role catalog; otherwise the role is a system role
-
revokeRoles
public void revokeRoles(Session session, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, Optional<String> catalog)
Description copied from interface:MetadataRevokes the specified roles from the specified grantees in the specified catalog- Specified by:
revokeRolesin interfaceMetadatagrantor- represents the principal specified by GRANTED BY statementcatalog- if present, the role catalog; otherwise the role is a system role
-
listApplicableRoles
public Set<RoleGrant> listApplicableRoles(Session session, TrinoPrincipal principal, Optional<String> catalog)
Description copied from interface:MetadataList applicable roles, including the transitive grants, for the specified principal- Specified by:
listApplicableRolesin interfaceMetadatacatalog- if present, the role catalog; otherwise the role is a system role
-
listEnabledRoles
public Set<String> listEnabledRoles(Identity identity)
Description copied from interface:MetadataList applicable system roles, including the transitive grants, for the given identity.- Specified by:
listEnabledRolesin interfaceMetadata
-
listEnabledRoles
public Set<String> listEnabledRoles(Session session, String catalog)
Description copied from interface:MetadataList applicable roles, including the transitive grants, in given catalog- Specified by:
listEnabledRolesin interfaceMetadatacatalog- if present, the role catalog; otherwise the role is a system role
-
grantTablePrivileges
public void grantTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:MetadataGrants the specified privilege to the specified user on the specified table- Specified by:
grantTablePrivilegesin interfaceMetadata
-
denyTablePrivileges
public void denyTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee)
Description copied from interface:MetadataDeny the specified privilege to the specified principal on the specified table- Specified by:
denyTablePrivilegesin interfaceMetadata
-
revokeTablePrivileges
public void revokeTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:MetadataRevokes the specified privilege on the specified table from the specified user- Specified by:
revokeTablePrivilegesin interfaceMetadata
-
grantSchemaPrivileges
public void grantSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:MetadataGrants the specified privilege to the specified user on the specified schema.- Specified by:
grantSchemaPrivilegesin interfaceMetadata
-
denySchemaPrivileges
public void denySchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee)
Description copied from interface:MetadataDeny the specified privilege to the specified principal on the specified schema.- Specified by:
denySchemaPrivilegesin interfaceMetadata
-
revokeSchemaPrivileges
public void revokeSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:MetadataRevokes the specified privilege on the specified schema from the specified user.- Specified by:
revokeSchemaPrivilegesin interfaceMetadata
-
listTablePrivileges
public List<GrantInfo> listTablePrivileges(Session session, QualifiedTablePrefix prefix)
Description copied from interface:MetadataGets the privileges for the specified table available to the given grantee considering the selected session role- Specified by:
listTablePrivilegesin interfaceMetadata
-
getType
public Type getType(TypeSignature signature)
-
fromSqlType
public Type fromSqlType(String sqlType)
- Specified by:
fromSqlTypein interfaceMetadata
-
getTypes
public Collection<Type> getTypes()
-
getParametricTypes
public Collection<ParametricType> getParametricTypes()
- Specified by:
getParametricTypesin interfaceMetadata
-
addType
public void addType(Type type)
-
addParametricType
public void addParametricType(ParametricType parametricType)
-
verifyTypes
public void verifyTypes()
- Specified by:
verifyTypesin interfaceMetadata
-
addFunctions
public void addFunctions(List<? extends SqlFunction> functionInfos)
- Specified by:
addFunctionsin interfaceMetadata
-
listFunctions
public List<FunctionMetadata> listFunctions()
- Specified by:
listFunctionsin interfaceMetadata
-
decodeFunction
public ResolvedFunction decodeFunction(QualifiedName name)
- Specified by:
decodeFunctionin interfaceMetadata
-
resolveFunction
public ResolvedFunction resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)
- Specified by:
resolveFunctionin interfaceMetadata
-
resolveOperator
public ResolvedFunction resolveOperator(Session session, OperatorType operatorType, List<? extends Type> argumentTypes) throws OperatorNotFoundException
- Specified by:
resolveOperatorin interfaceMetadata- Throws:
OperatorNotFoundException
-
getCoercion
public ResolvedFunction getCoercion(Session session, OperatorType operatorType, Type fromType, Type toType)
- Specified by:
getCoercionin interfaceMetadata
-
getCoercion
public ResolvedFunction getCoercion(Session session, QualifiedName name, Type fromType, Type toType)
- Specified by:
getCoercionin interfaceMetadata
-
resolve
public ResolvedFunction resolve(Session session, FunctionBinding functionBinding, FunctionMetadata functionMetadata, FunctionDependencyDeclaration declaration)
-
isAggregationFunction
public boolean isAggregationFunction(QualifiedName name)
Description copied from interface:MetadataIs the named function an aggregation function? This does not need type parameters because overloads between aggregation and other function types are not allowed.- Specified by:
isAggregationFunctionin interfaceMetadata
-
getFunctionMetadata
public FunctionMetadata getFunctionMetadata(ResolvedFunction resolvedFunction)
- Specified by:
getFunctionMetadatain interfaceMetadata
-
getAggregationFunctionMetadata
public AggregationFunctionMetadata getAggregationFunctionMetadata(ResolvedFunction resolvedFunction)
- Specified by:
getAggregationFunctionMetadatain interfaceMetadata
-
getWindowFunctionImplementation
public WindowFunctionSupplier getWindowFunctionImplementation(ResolvedFunction resolvedFunction)
- Specified by:
getWindowFunctionImplementationin interfaceMetadata
-
getAggregateFunctionImplementation
public InternalAggregationFunction getAggregateFunctionImplementation(ResolvedFunction resolvedFunction)
- Specified by:
getAggregateFunctionImplementationin interfaceMetadata
-
getScalarFunctionInvoker
public FunctionInvoker getScalarFunctionInvoker(ResolvedFunction resolvedFunction, InvocationConvention invocationConvention)
- Specified by:
getScalarFunctionInvokerin interfaceMetadata
-
toFunctionBinding
public static FunctionBinding toFunctionBinding(FunctionId functionId, BoundSignature boundSignature, Signature functionSignature)
-
getProcedureRegistry
public ProcedureRegistry getProcedureRegistry()
- Specified by:
getProcedureRegistryin interfaceMetadata
-
getTableProcedureRegistry
public TableProceduresRegistry getTableProcedureRegistry()
- Specified by:
getTableProcedureRegistryin interfaceMetadata
-
getBlockEncodingSerde
public BlockEncodingSerde getBlockEncodingSerde()
- Specified by:
getBlockEncodingSerdein interfaceMetadata
-
addBlockEncoding
public void addBlockEncoding(BlockEncoding blockEncoding)
-
getSessionPropertyManager
public SessionPropertyManager getSessionPropertyManager()
- Specified by:
getSessionPropertyManagerin interfaceMetadata
-
getSchemaPropertyManager
public SchemaPropertyManager getSchemaPropertyManager()
- Specified by:
getSchemaPropertyManagerin interfaceMetadata
-
getTablePropertyManager
public TablePropertyManager getTablePropertyManager()
- Specified by:
getTablePropertyManagerin interfaceMetadata
-
getMaterializedViewPropertyManager
public MaterializedViewPropertyManager getMaterializedViewPropertyManager()
- Specified by:
getMaterializedViewPropertyManagerin interfaceMetadata
-
getColumnPropertyManager
public ColumnPropertyManager getColumnPropertyManager()
- Specified by:
getColumnPropertyManagerin interfaceMetadata
-
getAnalyzePropertyManager
public AnalyzePropertyManager getAnalyzePropertyManager()
- Specified by:
getAnalyzePropertyManagerin interfaceMetadata
-
getTableProceduresPropertyManager
public TableProceduresPropertyManager getTableProceduresPropertyManager()
- Specified by:
getTableProceduresPropertyManagerin interfaceMetadata
-
isValidTableVersion
public boolean isValidTableVersion(Session session, QualifiedObjectName tableName, TableVersion version)
Description copied from interface:MetadataVerifies that a version is valid for a given table- Specified by:
isValidTableVersionin interfaceMetadata
-
-