Package io.trino.metadata
Interface Metadata
- All Known Implementing Classes:
MetadataManager,TracingMetadata
public interface Metadata
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(Session session, TableHandle tableHandle, CatalogSchemaTableName table, ColumnMetadata column) Add the specified column to the table.voidaddField(Session session, TableHandle tableHandle, List<String> parentPath, String fieldName, Type type, boolean ignoreExisting) Add the specified field to the column.applyAggregation(Session session, TableHandle table, List<AggregateFunction> aggregations, Map<String, ColumnHandle> assignments, List<List<ColumnHandle>> groupingSets) applyDelete(Session session, TableHandle tableHandle) Push delete into connectorapplyFilter(Session session, TableHandle table, Constraint constraint) applyJoin(Session session, JoinType joinType, TableHandle left, TableHandle right, ConnectorExpression joinCondition, Map<String, ColumnHandle> leftAssignments, Map<String, ColumnHandle> rightAssignments, JoinStatistics statistics) applyLimit(Session session, TableHandle table, long limit) applyProjection(Session session, TableHandle table, List<ConnectorExpression> projections, Map<String, ColumnHandle> assignments) applySample(Session session, TableHandle table, SampleType sampleType, double sampleRatio) applyTableFunction(Session session, TableFunctionHandle handle) applyTableScanRedirect(Session session, TableHandle tableHandle) Returns the result of redirecting the table scan on a given table to a different table.applyTopN(Session session, TableHandle handle, long topNCount, List<SortItem> sortItems, Map<String, ColumnHandle> assignments) applyUpdate(Session session, TableHandle tableHandle, Map<ColumnHandle, Constant> assignments) Push update into connectorbeginCreateTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, Optional<TableLayout> layout, boolean replace) Begin the atomic creation of a table with data.beginInsert(Session session, TableHandle tableHandle, List<ColumnHandle> columns) Begin insert querybeginMerge(Session session, TableHandle tableHandle) Begin merge queryvoidbeginQuery(Session session) Initialize before query beginsbeginRefreshMaterializedView(Session session, TableHandle tableHandle, List<TableHandle> sourceTableHandles) Begin refresh materialized view querybeginStatisticsCollection(Session session, TableHandle tableHandle) Begin statistics collectionbeginTableExecute(Session session, TableExecuteHandle handle, TableHandle updatedSourceTableHandle) booleancatalogExists(Session session, String catalogName) voidcleanupQuery(Session session) Cleanup after a query.voidcreateLanguageFunction(Session session, QualifiedObjectName name, LanguageFunction function, boolean replace) voidcreateMaterializedView(Session session, QualifiedObjectName viewName, MaterializedViewDefinition definition, Map<String, Object> properties, 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, SaveMode saveMode) Creates a table using the specified table metadata.voidcreateView(Session session, QualifiedObjectName viewName, ViewDefinition definition, Map<String, Object> properties, boolean replace) Creates the specified view with the specified view definition.booleandelegateMaterializedViewRefreshToConnector(Session session, QualifiedObjectName viewName) Returns true if materialized view refresh should be delegated to connectordefault voiddenyEntityPrivileges(Session session, EntityKindAndName entity, Set<EntityPrivilege> privileges, TrinoPrincipal grantee) Deny the specified privileges to the specified principal on the specified entity.voiddenySchemaPrivileges(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, CatalogSchemaTableName table, ColumnHandle column) Drop the specified column.voiddropField(Session session, TableHandle tableHandle, ColumnHandle column, List<String> fieldPath) Drop the specified field from the column.voiddropLanguageFunction(Session session, QualifiedObjectName name, String signatureToken) voiddropMaterializedView(Session session, QualifiedObjectName viewName) Drops the specified materialized view.voiddropNotNullConstraint(Session session, TableHandle tableHandle, ColumnHandle column) Drop a not null constraint on the specified column.voidDrops the specified role in the specified catalog.voiddropSchema(Session session, CatalogSchemaName schema, boolean cascade) Drops the specified schema.voiddropTable(Session session, TableHandle tableHandle, CatalogSchemaTableName tableName) Drops the specified tablevoiddropView(Session session, QualifiedObjectName viewName) Drops the specified view.executeDelete(Session session, TableHandle tableHandle) Execute delete in connectorvoidexecuteTableExecute(Session session, TableExecuteHandle handle) executeUpdate(Session session, TableHandle tableHandle) Execute update in connectorfinishCreateTable(Session session, OutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics) Finish a table creation with data after the data is written.finishInsert(Session session, InsertTableHandle tableHandle, List<TableHandle> sourceTableHandles, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics) Finish insert queryvoidfinishMerge(Session session, MergeHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics) Finish merge queryfinishRefreshMaterializedView(Session session, TableHandle tableHandle, InsertTableHandle insertTableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics, List<TableHandle> sourceTableHandles, List<String> sourceTableFunctions) Finish refresh materialized view queryvoidfinishStatisticsCollection(Session session, AnalyzeTableHandle tableHandle, Collection<ComputedStatistics> computedStatistics) Finish statistics collectionvoidfinishTableExecute(Session session, TableExecuteHandle handle, Collection<io.airlift.slice.Slice> fragments, List<Object> tableExecuteState) getAggregationFunctionMetadata(Session session, ResolvedFunction resolvedFunction) default Set<EntityPrivilege> getAllEntityKindPrivileges(String entityKind) Gets all the EntityPrivileges associated with an entityKind.getCatalogHandle(Session session, String catalogName) Returns a catalog handle for the specified catalog name.getCoercion(CatalogSchemaFunctionName name, Type fromType, Type toType) getCoercion(OperatorType operatorType, Type fromType, Type toType) default ResolvedFunctiongetCoercion(Type fromType, Type toType) getColumnHandles(Session session, TableHandle tableHandle) Gets all of the columns on the specified table, or an empty map if the columns cannot be enumerated.getColumnMetadata(Session session, TableHandle tableHandle, ColumnHandle columnHandle) Gets the metadata for the specified table column.getCommonPartitioning(Session session, PartitioningHandle left, PartitioningHandle right) Return a partitioning handle which the connector can transparently convert bothleftandrightinto.getConnectorCapabilities(Session session, CatalogHandle catalogHandle) getFunctionDependencies(Session session, CatalogHandle catalogHandle, FunctionId functionId, BoundSignature boundSignature) getFunctions(Session session, CatalogSchemaFunctionName catalogSchemaFunctionName) getInfo(Session session, TableHandle handle) getInsertLayout(Session session, TableHandle target) getInsertWriterScalingOptions(Session session, TableHandle tableHandle) Returns writer scaling options for the specified table.getLayoutForTableExecute(Session session, TableExecuteHandle tableExecuteHandle) getMaterializedView(Session session, QualifiedObjectName viewName) Returns the materialized view definition for the specified view name.getMaterializedViewFreshness(Session session, QualifiedObjectName name) Method to get difference between the states of table at two different points in time/or as of given token-ids.getMaterializedViewProperties(Session session, QualifiedObjectName objectName, MaterializedViewDefinition materializedViewDefinition) getMaterializedViews(Session session, QualifiedTablePrefix prefix) Get the materialized view definitions that match the specified table prefix (never null).getMaxWriterTasks(Session session, String catalogName) Returns maximum number of tasks that can be created while writing data to specific connector.getMergeRowIdColumnHandle(Session session, TableHandle tableHandle) Get the column handle that will generate row IDs for the merge operation.getNewTableLayout(Session session, String catalogName, ConnectorTableMetadata tableMetadata) getNewTableWriterScalingOptions(Session session, QualifiedObjectName tableName, Map<String, Object> tableProperties) Returns writer scaling options for the specified table.getRedirectionAwareTableHandle(Session session, QualifiedObjectName tableName) Get the target table handle after performing redirection.getRedirectionAwareTableHandle(Session session, QualifiedObjectName tableName, Optional<TableVersion> startVersion, Optional<TableVersion> endVersion) Get the target table handle after performing redirection with a table version.getRelationTypes(Session session, QualifiedTablePrefix prefix) Get the relation names that match the specified table prefix (never null).getRowChangeParadigm(Session session, TableHandle tableHandle) Return the row update paradigm supported by the connector on the table or throw an exception if row change is not supported.getSchemaOwner(Session session, CatalogSchemaName schemaName) Gets the schema owner for the specified schema.getSchemaProperties(Session session, CatalogSchemaName schemaName) Gets the schema properties for the specified schema.getStatisticsCollectionMetadata(Session session, TableHandle tableHandle, Map<String, Object> analyzeProperties) Describe statistics that must be collected during a statistics collectiongetStatisticsCollectionMetadataForWrite(Session session, CatalogHandle catalogHandle, ConnectorTableMetadata tableMetadata) Describes statistics that must be collected during a write.getSupportedType(Session session, CatalogHandle catalogHandle, Map<String, Object> tableProperties, Type type) Return the effectiveTypethat is supported by the connector for the given type, ifOptional.empty()is returned, the type will be used as is during table creation which may or may not be supported by the connector.getSystemTable(Session session, QualifiedObjectName tableName) getTableHandle(Session session, QualifiedObjectName tableName) Returns a table handle for the specified table name.getTableHandle(Session session, QualifiedObjectName tableName, Optional<TableVersion> startVersion, Optional<TableVersion> endVersion) Returns a table handle for the specified table name with a specified versiongetTableHandleForExecute(Session session, TableHandle tableHandle, String procedureName, Map<String, Object> executeProperties) getTableMetadata(Session session, TableHandle tableHandle) Return the metadata for the specified table handle.getTableName(Session session, TableHandle tableHandle) getTableProperties(Session session, TableHandle handle) getTableSchema(Session session, TableHandle tableHandle) Return table schema definition for the specified table handle.getTableStatistics(Session session, TableHandle tableHandle) Return statistics for specified table.getUpdateLayout(Session session, TableHandle tableHandle) Get the physical layout for updated or deleted rows of a MERGE operation.getView(Session session, QualifiedObjectName viewName) Returns the view definition for the specified view name.getViewProperties(Session session, QualifiedObjectName viewName) Returns the view definition for the specified view name.getViews(Session session, QualifiedTablePrefix prefix) Get the view definitions that match the specified table prefix (never null).default voidgrantEntityPrivileges(Session session, EntityKindAndName entity, Set<EntityPrivilege> privileges, TrinoPrincipal grantee, boolean grantOption) Grants the specified privileges to the specified user on the specified grantee.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 tablebooleanisCatalogManagedSecurity(Session session, String catalog) Does the specified catalog manage security directly, or does it use system security management?default booleanisMaterializedView(Session session, QualifiedObjectName viewName) Is the specified table a materialized view.default booleanisView(Session session, QualifiedObjectName viewName) Is the specified table a view.booleanlanguageFunctionExists(Session session, QualifiedObjectName name, String signatureToken) listApplicableRoles(Session session, TrinoPrincipal principal, Optional<String> catalog) List applicable roles, including the transitive grants, for the specified principallistCatalogs(Session session) Gets all the loaded catalogslistEnabledRoles(Session session, String catalog) List applicable roles, including the transitive grants, in given cataloglistEnabledRoles(Identity identity) List applicable system roles, including the transitive grants, for the given identity.listFunctions(Session session, CatalogSchemaName schema) listGlobalFunctions(Session session) listMaterializedViews(Session session, QualifiedTablePrefix prefix) Get the names that match the specified table prefix (never null).listRelationComments(Session session, String catalogName, Optional<String> schemaName, UnaryOperator<Set<SchemaTableName>> relationFilter) Gets the comments metadata for all relations (tables, views, materialized views) that match the specified prefix.listRoleGrants(Session session, Optional<String> catalog, TrinoPrincipal principal) List roles grants in the specified catalog for a given principal, not recursively.List available roles in specified catalog.listSchemaNames(Session session, String catalogName) listTableColumns(Session session, QualifiedTablePrefix prefix, UnaryOperator<Set<SchemaTableName>> relationFilter) Gets the columns metadata for all tables that match the specified prefix.listTablePrivileges(Session session, QualifiedTablePrefix prefix) Gets the privileges for the specified table available to the given grantee considering the selected session rolelistTables(Session session, QualifiedTablePrefix prefix) Get the relation names that match the specified table prefix (never null).listViews(Session session, QualifiedTablePrefix prefix) Get the names that match the specified table prefix (never null).makeCompatiblePartitioning(Session session, TableHandle table, 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, CatalogSchemaTableName table, ColumnHandle source, String target) Rename the specified column.voidrenameField(Session session, TableHandle tableHandle, List<String> fieldPath, String target) Rename the specified field.voidrenameMaterializedView(Session session, QualifiedObjectName existingViewName, QualifiedObjectName newViewName) Rename the specified materialized view.voidrenameSchema(Session session, CatalogSchemaName source, String target) Renames the specified schema.voidrenameTable(Session session, TableHandle tableHandle, CatalogSchemaTableName currentTableName, QualifiedObjectName newTableName) Rename the specified table.voidrenameView(Session session, QualifiedObjectName existingViewName, QualifiedObjectName newViewName) Rename the specified view.resolveBuiltinFunction(String name, List<TypeSignatureProvider> parameterTypes) 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.resolveOperator(OperatorType operatorType, List<? extends Type> argumentTypes) default voidrevokeEntityPrivileges(Session session, EntityKindAndName entity, Set<EntityPrivilege> privileges, TrinoPrincipal grantee, boolean grantOption) Revokes the specified privilege on the specified entity from the specified grantee.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 user.booleanroleExists(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.voidsetColumnType(Session session, TableHandle tableHandle, ColumnHandle column, Type type) Set the specified type to the column.voidsetFieldType(Session session, TableHandle tableHandle, List<String> fieldPath, Type type) Set the specified type to the field.voidsetMaterializedViewColumnComment(Session session, QualifiedObjectName viewName, String columnName, Optional<String> comment) Comments to the specified materialized view column.voidsetMaterializedViewProperties(Session session, QualifiedObjectName viewName, Map<String, Optional<Object>> properties) Sets the properties of the specified materialized view.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, Optional<Object>> properties) Set properties to the specified table.voidsetViewAuthorization(Session session, CatalogSchemaTableName view, TrinoPrincipal principal) Set the authorization (owner) of specified view's user/rolevoidsetViewColumnComment(Session session, QualifiedObjectName viewName, String columnName, Optional<String> comment) Comments to the specified view column.voidsetViewComment(Session session, QualifiedObjectName viewName, Optional<String> comment) Comments to the specified view.booleansupportsMissingColumnsOnInsert(Session session, TableHandle tableHandle) voidtruncateTable(Session session, TableHandle tableHandle) Truncates the specified tabledefault voidvalidateScan(Session session, TableHandle table)
-
Method Details
-
getConnectorCapabilities
-
catalogExists
-
schemaExists
-
listSchemaNames
-
getTableHandle
Returns a table handle for the specified table name. -
getSystemTable
-
getTableHandleForExecute
Optional<TableExecuteHandle> getTableHandleForExecute(Session session, TableHandle tableHandle, String procedureName, Map<String, Object> executeProperties) -
getLayoutForTableExecute
Optional<TableLayout> getLayoutForTableExecute(Session session, TableExecuteHandle tableExecuteHandle) -
beginTableExecute
BeginTableExecuteResult<TableExecuteHandle,TableHandle> beginTableExecute(Session session, TableExecuteHandle handle, TableHandle updatedSourceTableHandle) -
finishTableExecute
void finishTableExecute(Session session, TableExecuteHandle handle, Collection<io.airlift.slice.Slice> fragments, List<Object> tableExecuteState) -
executeTableExecute
-
getTableProperties
-
makeCompatiblePartitioning
TableHandle makeCompatiblePartitioning(Session session, TableHandle table, PartitioningHandle partitioningHandle) Return 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 bygetCommonPartitioning(io.trino.Session, io.trino.sql.planner.PartitioningHandle, io.trino.sql.planner.PartitioningHandle). -
getCommonPartitioning
Optional<PartitioningHandle> getCommonPartitioning(Session session, PartitioningHandle left, PartitioningHandle right) Return a partitioning handle which the connector can transparently convert bothleftandrightinto. -
getInfo
-
getTableName
-
getTableSchema
Return table schema definition for the specified table handle. Table schema definition is a set of information required by semantic analyzer to analyze the query.- Throws:
RuntimeException- if table handle is no longer valid- See Also:
-
getTableMetadata
Return the metadata for the specified table handle.- Throws:
RuntimeException- if table handle is no longer valid- See Also:
-
getTableStatistics
Return statistics for specified table. -
listTables
Get the relation names that match the specified table prefix (never null). This includes all relations (e.g. tables, views, materialized views). -
getRelationTypes
Get the relation names that match the specified table prefix (never null). This includes all relations (e.g. tables, views, materialized views). -
getColumnHandles
Gets all of the columns on the specified table, or an empty map if the columns cannot be enumerated.- Throws:
RuntimeException- if table handle is no longer valid
-
getColumnMetadata
ColumnMetadata getColumnMetadata(Session session, TableHandle tableHandle, ColumnHandle columnHandle) Gets the metadata for the specified table column.- Throws:
RuntimeException- if table or column handles are no longer valid
-
listTableColumns
List<TableColumnsMetadata> listTableColumns(Session session, QualifiedTablePrefix prefix, UnaryOperator<Set<SchemaTableName>> relationFilter) Gets the columns metadata for all tables that match the specified prefix. TODO: consider returning a stream for more efficient processing -
listRelationComments
List<RelationCommentMetadata> listRelationComments(Session session, String catalogName, Optional<String> schemaName, UnaryOperator<Set<SchemaTableName>> relationFilter) Gets the comments metadata for all relations (tables, views, materialized views) that match the specified prefix. TODO: consider returning a stream for more efficient processing -
createSchema
void createSchema(Session session, CatalogSchemaName schema, Map<String, Object> properties, TrinoPrincipal principal) Creates a schema.- Parameters:
principal- TODO
-
dropSchema
Drops the specified schema. -
renameSchema
Renames the specified schema. -
setSchemaAuthorization
Set the specified schema's user/role. -
createTable
void createTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, SaveMode saveMode) Creates a table using the specified table metadata.- Throws:
TrinoException- withALREADY_EXISTSif the table already exists andsaveModeis set to FAIL.
-
renameTable
void renameTable(Session session, TableHandle tableHandle, CatalogSchemaTableName currentTableName, QualifiedObjectName newTableName) Rename the specified table. -
setTableProperties
void setTableProperties(Session session, TableHandle tableHandle, Map<String, Optional<Object>> properties) Set properties to the specified table. -
setTableComment
Comments to the specified table. -
setViewComment
Comments to the specified view. -
setViewColumnComment
void setViewColumnComment(Session session, QualifiedObjectName viewName, String columnName, Optional<String> comment) Comments to the specified view column. -
setColumnComment
void setColumnComment(Session session, TableHandle tableHandle, ColumnHandle column, Optional<String> comment) Comments to the specified column. -
renameColumn
void renameColumn(Session session, TableHandle tableHandle, CatalogSchemaTableName table, ColumnHandle source, String target) Rename the specified column. -
renameField
Rename the specified field. -
addColumn
void addColumn(Session session, TableHandle tableHandle, CatalogSchemaTableName table, ColumnMetadata column) Add the specified column to the table. -
addField
void addField(Session session, TableHandle tableHandle, List<String> parentPath, String fieldName, Type type, boolean ignoreExisting) Add the specified field to the column. -
setColumnType
Set the specified type to the column. -
setFieldType
Set the specified type to the field. -
dropNotNullConstraint
Drop a not null constraint on the specified column. -
setTableAuthorization
Set the authorization (owner) of specified table's user/role -
dropColumn
void dropColumn(Session session, TableHandle tableHandle, CatalogSchemaTableName table, ColumnHandle column) Drop the specified column. -
dropField
void dropField(Session session, TableHandle tableHandle, ColumnHandle column, List<String> fieldPath) Drop the specified field from the column. -
dropTable
Drops the specified table- Throws:
RuntimeException- if the table cannot be dropped or table handle is no longer valid
-
truncateTable
Truncates the specified table -
getNewTableLayout
Optional<TableLayout> getNewTableLayout(Session session, String catalogName, ConnectorTableMetadata tableMetadata) -
getSupportedType
Optional<Type> getSupportedType(Session session, CatalogHandle catalogHandle, Map<String, Object> tableProperties, Type type) Return the effectiveTypethat is supported by the connector for the given type, ifOptional.empty()is returned, the type will be used as is during table creation which may or may not be supported by the connector. -
beginCreateTable
OutputTableHandle beginCreateTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, Optional<TableLayout> layout, boolean replace) Begin the atomic creation of a table with data. -
finishCreateTable
Optional<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. -
getInsertLayout
-
getStatisticsCollectionMetadataForWrite
TableStatisticsMetadata getStatisticsCollectionMetadataForWrite(Session session, CatalogHandle catalogHandle, ConnectorTableMetadata tableMetadata) Describes statistics that must be collected during a write. -
getStatisticsCollectionMetadata
AnalyzeMetadata getStatisticsCollectionMetadata(Session session, TableHandle tableHandle, Map<String, Object> analyzeProperties) Describe statistics that must be collected during a statistics collection -
beginStatisticsCollection
Begin statistics collection -
finishStatisticsCollection
void finishStatisticsCollection(Session session, AnalyzeTableHandle tableHandle, Collection<ComputedStatistics> computedStatistics) Finish statistics collection -
beginQuery
Initialize before query begins -
cleanupQuery
Cleanup 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. -
beginInsert
Begin insert query -
supportsMissingColumnsOnInsert
- Returns:
- whether connector handles missing columns during insert
-
finishInsert
Optional<ConnectorOutputMetadata> finishInsert(Session session, InsertTableHandle tableHandle, List<TableHandle> sourceTableHandles, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics) Finish insert query -
delegateMaterializedViewRefreshToConnector
Returns true if materialized view refresh should be delegated to connector -
refreshMaterializedView
com.google.common.util.concurrent.ListenableFuture<Void> refreshMaterializedView(Session session, QualifiedObjectName viewName) Refresh materialized view -
beginRefreshMaterializedView
InsertTableHandle beginRefreshMaterializedView(Session session, TableHandle tableHandle, List<TableHandle> sourceTableHandles) Begin refresh materialized view query -
finishRefreshMaterializedView
Optional<ConnectorOutputMetadata> finishRefreshMaterializedView(Session session, TableHandle tableHandle, InsertTableHandle insertTableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics, List<TableHandle> sourceTableHandles, List<String> sourceTableFunctions) Finish refresh materialized view query -
applyUpdate
Optional<TableHandle> applyUpdate(Session session, TableHandle tableHandle, Map<ColumnHandle, Constant> assignments) Push update into connector -
executeUpdate
Execute update in connector -
applyDelete
Push delete into connector -
executeDelete
Execute delete in connector -
getRowChangeParadigm
Return the row update paradigm supported by the connector on the table or throw an exception if row change is not supported. -
getMergeRowIdColumnHandle
Get the column handle that will generate row IDs for the merge operation. These IDs will be passed to thestoreMergedRows()method of theConnectorMergeSinkthat created them. -
getUpdateLayout
Get the physical layout for updated or deleted rows of a MERGE operation. -
beginMerge
Begin merge query -
finishMerge
void finishMerge(Session session, MergeHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics) Finish merge query -
getCatalogHandle
Returns a catalog handle for the specified catalog name. -
listCatalogs
Gets all the loaded catalogs -
listViews
Get the names that match the specified table prefix (never null). -
getViews
Get the view definitions that match the specified table prefix (never null). -
isView
Is the specified table a view. -
getView
Returns the view definition for the specified view name. -
getViewProperties
Returns the view definition for the specified view name. -
getSchemaProperties
Gets the schema properties for the specified schema. -
getSchemaOwner
Gets the schema owner for the specified schema. -
createView
void createView(Session session, QualifiedObjectName viewName, ViewDefinition definition, Map<String, Object> properties, boolean replace) Creates the specified view with the specified view definition. -
renameView
void renameView(Session session, QualifiedObjectName existingViewName, QualifiedObjectName newViewName) Rename the specified view. -
setViewAuthorization
Set the authorization (owner) of specified view's user/role -
dropView
Drops the specified view. -
resolveIndex
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. -
applyLimit
Optional<LimitApplicationResult<TableHandle>> applyLimit(Session session, TableHandle table, long limit) -
applyFilter
Optional<ConstraintApplicationResult<TableHandle>> applyFilter(Session session, TableHandle table, Constraint constraint) -
applyProjection
Optional<ProjectionApplicationResult<TableHandle>> applyProjection(Session session, TableHandle table, List<ConnectorExpression> projections, Map<String, ColumnHandle> assignments) -
applySample
Optional<SampleApplicationResult<TableHandle>> applySample(Session session, TableHandle table, SampleType sampleType, double sampleRatio) -
applyAggregation
Optional<AggregationApplicationResult<TableHandle>> applyAggregation(Session session, TableHandle table, List<AggregateFunction> aggregations, Map<String, ColumnHandle> assignments, List<List<ColumnHandle>> groupingSets) -
applyJoin
Optional<JoinApplicationResult<TableHandle>> applyJoin(Session session, JoinType joinType, TableHandle left, TableHandle right, ConnectorExpression joinCondition, Map<String, ColumnHandle> leftAssignments, Map<String, ColumnHandle> rightAssignments, JoinStatistics statistics) -
applyTopN
Optional<TopNApplicationResult<TableHandle>> applyTopN(Session session, TableHandle handle, long topNCount, List<SortItem> sortItems, Map<String, ColumnHandle> assignments) -
applyTableFunction
Optional<TableFunctionApplicationResult<TableHandle>> applyTableFunction(Session session, TableFunctionHandle handle) -
validateScan
-
isCatalogManagedSecurity
Does the specified catalog manage security directly, or does it use system security management? -
roleExists
Does the specified role exist.- Parameters:
catalog- if present, the role catalog; otherwise the role is a system role
-
createRole
void createRole(Session session, String role, Optional<TrinoPrincipal> grantor, Optional<String> catalog) Creates the specified role in the specified catalog.- Parameters:
grantor- represents the principal specified by WITH ADMIN statementcatalog- if present, the role catalog; otherwise the role is a system role
-
dropRole
Drops the specified role in the specified catalog.- Parameters:
catalog- if present, the role catalog; otherwise the role is a system role
-
listRoles
List available roles in specified catalog.- Parameters:
catalog- if present, the role catalog; otherwise the role is a system role
-
listRoleGrants
List roles grants in the specified catalog for a given principal, not recursively.- Parameters:
catalog- if present, the role catalog; otherwise the role is a system role
-
grantRoles
void grantRoles(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 catalog- Parameters:
grantor- represents the principal specified by GRANTED BY statementcatalog- if present, the role catalog; otherwise the role is a system role
-
revokeRoles
void revokeRoles(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 catalog- Parameters:
grantor- represents the principal specified by GRANTED BY statementcatalog- if present, the role catalog; otherwise the role is a system role
-
listApplicableRoles
Set<RoleGrant> listApplicableRoles(Session session, TrinoPrincipal principal, Optional<String> catalog) List applicable roles, including the transitive grants, for the specified principal- Parameters:
catalog- if present, the role catalog; otherwise the role is a system role
-
listEnabledRoles
List applicable system roles, including the transitive grants, for the given identity. -
listEnabledRoles
List applicable roles, including the transitive grants, in given catalog- Parameters:
catalog- if present, the role catalog; otherwise the role is a system role
-
grantSchemaPrivileges
void grantSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption) Grants the specified privilege to the specified user on the specified schema. -
denySchemaPrivileges
void denySchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee) Deny the specified privilege to the specified principal on the specified schema. -
revokeSchemaPrivileges
void revokeSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption) Revokes the specified privilege on the specified schema from the specified user. -
grantTablePrivileges
void grantTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption) Grants the specified privilege to the specified user on the specified table -
denyTablePrivileges
void denyTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee) Deny the specified privilege to the specified principal on the specified table -
revokeTablePrivileges
void revokeTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption) Revokes the specified privilege on the specified table from the specified user. -
listTablePrivileges
Gets the privileges for the specified table available to the given grantee considering the selected session role -
getAllEntityKindPrivileges
Gets all the EntityPrivileges associated with an entityKind. Defines ALL PRIVILEGES for the entityKind -
grantEntityPrivileges
default void grantEntityPrivileges(Session session, EntityKindAndName entity, Set<EntityPrivilege> privileges, TrinoPrincipal grantee, boolean grantOption) Grants the specified privileges to the specified user on the specified grantee. If the set of privileges is empty, it is interpreted as all privileges for the entityKind. -
denyEntityPrivileges
default void denyEntityPrivileges(Session session, EntityKindAndName entity, Set<EntityPrivilege> privileges, TrinoPrincipal grantee) Deny the specified privileges to the specified principal on the specified entity. If the set of privileges is empty, it is interpreted as all privileges for the entityKind. -
revokeEntityPrivileges
default void revokeEntityPrivileges(Session session, EntityKindAndName entity, Set<EntityPrivilege> privileges, TrinoPrincipal grantee, boolean grantOption) Revokes the specified privilege on the specified entity from the specified grantee. If the set of privileges is empty, it is interpreted as all privileges for the entityKind. -
listGlobalFunctions
-
listFunctions
-
getFunctions
Collection<CatalogFunctionMetadata> getFunctions(Session session, CatalogSchemaFunctionName catalogSchemaFunctionName) -
resolveBuiltinFunction
-
resolveOperator
ResolvedFunction resolveOperator(OperatorType operatorType, List<? extends Type> argumentTypes) throws OperatorNotFoundException - Throws:
OperatorNotFoundException
-
getCoercion
-
getCoercion
-
getCoercion
-
getAggregationFunctionMetadata
AggregationFunctionMetadata getAggregationFunctionMetadata(Session session, ResolvedFunction resolvedFunction) -
getFunctionDependencies
FunctionDependencyDeclaration getFunctionDependencies(Session session, CatalogHandle catalogHandle, FunctionId functionId, BoundSignature boundSignature) -
languageFunctionExists
-
createLanguageFunction
void createLanguageFunction(Session session, QualifiedObjectName name, LanguageFunction function, boolean replace) -
dropLanguageFunction
-
createMaterializedView
void createMaterializedView(Session session, QualifiedObjectName viewName, MaterializedViewDefinition definition, Map<String, Object> properties, boolean replace, boolean ignoreExisting) Creates the specified materialized view with the specified view definition. -
dropMaterializedView
Drops the specified materialized view. -
listMaterializedViews
Get the names that match the specified table prefix (never null). -
getMaterializedViews
Map<QualifiedObjectName,ViewInfo> getMaterializedViews(Session session, QualifiedTablePrefix prefix) Get the materialized view definitions that match the specified table prefix (never null). -
isMaterializedView
Is the specified table a materialized view. -
getMaterializedView
Optional<MaterializedViewDefinition> getMaterializedView(Session session, QualifiedObjectName viewName) Returns the materialized view definition for the specified view name. -
getMaterializedViewProperties
Map<String,Object> getMaterializedViewProperties(Session session, QualifiedObjectName objectName, MaterializedViewDefinition materializedViewDefinition) -
getMaterializedViewFreshness
Method 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. -
renameMaterializedView
void renameMaterializedView(Session session, QualifiedObjectName existingViewName, QualifiedObjectName newViewName) Rename the specified materialized view. -
setMaterializedViewProperties
void setMaterializedViewProperties(Session session, QualifiedObjectName viewName, Map<String, Optional<Object>> properties) Sets the properties of the specified materialized view. -
setMaterializedViewColumnComment
void setMaterializedViewColumnComment(Session session, QualifiedObjectName viewName, String columnName, Optional<String> comment) Comments to the specified materialized view column. -
applyTableScanRedirect
Optional<TableScanRedirectApplicationResult> applyTableScanRedirect(Session session, TableHandle tableHandle) Returns 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. -
getRedirectionAwareTableHandle
RedirectionAwareTableHandle getRedirectionAwareTableHandle(Session session, QualifiedObjectName tableName) Get the target table handle after performing redirection. -
getRedirectionAwareTableHandle
RedirectionAwareTableHandle getRedirectionAwareTableHandle(Session session, QualifiedObjectName tableName, Optional<TableVersion> startVersion, Optional<TableVersion> endVersion) Get the target table handle after performing redirection with a table version. -
getTableHandle
Optional<TableHandle> getTableHandle(Session session, QualifiedObjectName tableName, Optional<TableVersion> startVersion, Optional<TableVersion> endVersion) Returns a table handle for the specified table name with a specified version -
getMaxWriterTasks
Returns maximum number of tasks that can be created while writing data to specific connector. Note: It is ignored when retry policy is set to TASK -
getNewTableWriterScalingOptions
WriterScalingOptions getNewTableWriterScalingOptions(Session session, QualifiedObjectName tableName, Map<String, Object> tableProperties) Returns writer scaling options for the specified table. This method is called when table handle is not available during CTAS. -
getInsertWriterScalingOptions
Returns writer scaling options for the specified table.
-