Package io.trino.plugin.jdbc
Class DefaultJdbcMetadata
java.lang.Object
io.trino.plugin.jdbc.DefaultJdbcMetadata
- All Implemented Interfaces:
JdbcMetadata,ConnectorMetadata
-
Field Summary
Fields inherited from interface io.trino.spi.connector.ConnectorMetadata
MODIFYING_ROWS_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultJdbcMetadata(JdbcClient jdbcClient, boolean precalculateStatisticsForPushdown, Set<JdbcQueryEventListener> jdbcQueryEventListeners) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(ConnectorSession session, ConnectorTableHandle table, ColumnMetadata columnMetadata) applyAggregation(ConnectorSession session, ConnectorTableHandle table, List<AggregateFunction> aggregates, Map<String, ColumnHandle> assignments, List<List<ColumnHandle>> groupingSets) applyDelete(ConnectorSession session, ConnectorTableHandle handle) applyFilter(ConnectorSession session, ConnectorTableHandle table, Constraint constraint) applyJoin(ConnectorSession session, JoinType joinType, ConnectorTableHandle left, ConnectorTableHandle right, List<JoinCondition> joinConditions, Map<String, ColumnHandle> leftAssignments, Map<String, ColumnHandle> rightAssignments, JoinStatistics statistics) applyLimit(ConnectorSession session, ConnectorTableHandle table, long limit) applyProjection(ConnectorSession session, ConnectorTableHandle table, List<ConnectorExpression> projections, Map<String, ColumnHandle> assignments) applyTableFunction(ConnectorSession session, ConnectorTableFunctionHandle handle) applyTableScanRedirect(ConnectorSession session, ConnectorTableHandle table) applyTopN(ConnectorSession session, ConnectorTableHandle table, long topNCount, List<SortItem> sortItems, Map<String, ColumnHandle> assignments) beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorTableLayout> layout, RetryMode retryMode) beginInsert(ConnectorSession session, ConnectorTableHandle tableHandle, List<ColumnHandle> columns, RetryMode retryMode) voidbeginQuery(ConnectorSession session) voidcleanupQuery(ConnectorSession session) voidcreateSchema(ConnectorSession session, String schemaName, Map<String, Object> properties, TrinoPrincipal owner) voidcreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, boolean ignoreExisting) voiddropColumn(ConnectorSession session, ConnectorTableHandle table, ColumnHandle column) voiddropSchema(ConnectorSession session, String schemaName) voiddropTable(ConnectorSession session, ConnectorTableHandle tableHandle) executeDelete(ConnectorSession session, ConnectorTableHandle handle) finishCreateTable(ConnectorSession session, ConnectorOutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics) finishInsert(ConnectorSession session, ConnectorInsertTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics) getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle) getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle) getMergeRowIdColumnHandle(ConnectorSession session, ConnectorTableHandle tableHandle) getProcedureHandle(ConnectorSession session, JdbcProcedureHandle.ProcedureQuery procedureQuery) getSystemTable(ConnectorSession session, SchemaTableName tableName) getTableComment(JdbcTableHandle handle) getTableHandle(ConnectorSession session, PreparedQuery preparedQuery) getTableHandle(ConnectorSession session, SchemaTableName tableName) getTableMetadata(ConnectorSession session, ConnectorTableHandle table) getTableName(ConnectorSession session, ConnectorTableHandle table) getTableSchema(ConnectorSession session, ConnectorTableHandle table) getTableStatistics(ConnectorSession session, ConnectorTableHandle tableHandle) listSchemaNames(ConnectorSession session) listTableColumns(ConnectorSession session, SchemaTablePrefix prefix) listTables(ConnectorSession session, Optional<String> schemaName) voidrenameColumn(ConnectorSession session, ConnectorTableHandle table, ColumnHandle column, String target) voidrenameSchema(ConnectorSession session, String schemaName, String newSchemaName) voidrenameTable(ConnectorSession session, ConnectorTableHandle table, SchemaTableName newTableName) voidrollback()booleanschemaExists(ConnectorSession session, String schemaName) voidsetColumnComment(ConnectorSession session, ConnectorTableHandle table, ColumnHandle column, Optional<String> comment) voidsetColumnType(ConnectorSession session, ConnectorTableHandle table, ColumnHandle column, Type type) voidsetTableComment(ConnectorSession session, ConnectorTableHandle table, Optional<String> comment) voidsetTableProperties(ConnectorSession session, ConnectorTableHandle table, Map<String, Optional<Object>> properties) booleanvoidtruncateTable(ConnectorSession session, ConnectorTableHandle tableHandle) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.trino.spi.connector.ConnectorMetadata
applyJoin, applySample, beginMerge, beginRefreshMaterializedView, beginStatisticsCollection, beginTableExecute, createMaterializedView, createRole, createView, delegateMaterializedViewRefreshToConnector, denySchemaPrivileges, denyTablePrivileges, dropField, dropMaterializedView, dropRole, dropView, executeTableExecute, finishMerge, finishRefreshMaterializedView, finishStatisticsCollection, finishTableExecute, getAggregationFunctionMetadata, getCommonPartitioningHandle, getFunctionDependencies, getFunctionMetadata, getFunctions, getInfo, getInsertLayout, getLayoutForTableExecute, getMaterializedView, getMaterializedViewFreshness, getMaterializedViews, getMaxWriterTasks, getNewTableLayout, getRowChangeParadigm, getSchemaOwner, getSchemaOwner, getSchemaProperties, getSchemaProperties, getSchemaTableName, getStatisticsCollectionMetadata, getStatisticsCollectionMetadataForWrite, getTableHandle, getTableHandleForExecute, getTableProperties, getUpdateLayout, getView, getViews, grantRoles, grantSchemaPrivileges, grantTablePrivileges, listApplicableRoles, listEnabledRoles, listFunctions, listMaterializedViews, listRoleGrants, listRoles, listTablePrivileges, listViews, makeCompatiblePartitioning, redirectTable, refreshMaterializedView, renameMaterializedView, renameView, resolveIndex, revokeRoles, revokeSchemaPrivileges, revokeTablePrivileges, roleExists, setMaterializedViewProperties, setSchemaAuthorization, setTableAuthorization, setViewAuthorization, setViewColumnComment, setViewComment, streamTableColumns, supportsReportingWrittenBytes, supportsReportingWrittenBytes, validateScan
-
Constructor Details
-
DefaultJdbcMetadata
public DefaultJdbcMetadata(JdbcClient jdbcClient, boolean precalculateStatisticsForPushdown, Set<JdbcQueryEventListener> jdbcQueryEventListeners)
-
-
Method Details
-
schemaExists
- Specified by:
schemaExistsin interfaceConnectorMetadata
-
listSchemaNames
- Specified by:
listSchemaNamesin interfaceConnectorMetadata
-
getTableHandle
- Specified by:
getTableHandlein interfaceConnectorMetadata
-
getTableHandle
- Specified by:
getTableHandlein interfaceJdbcMetadata
-
getProcedureHandle
public JdbcProcedureHandle getProcedureHandle(ConnectorSession session, JdbcProcedureHandle.ProcedureQuery procedureQuery) - Specified by:
getProcedureHandlein interfaceJdbcMetadata
-
getSystemTable
- Specified by:
getSystemTablein interfaceConnectorMetadata
-
applyFilter
public Optional<ConstraintApplicationResult<ConnectorTableHandle>> applyFilter(ConnectorSession session, ConnectorTableHandle table, Constraint constraint) - Specified by:
applyFilterin interfaceConnectorMetadata
-
applyProjection
public Optional<ProjectionApplicationResult<ConnectorTableHandle>> applyProjection(ConnectorSession session, ConnectorTableHandle table, List<ConnectorExpression> projections, Map<String, ColumnHandle> assignments) - Specified by:
applyProjectionin interfaceConnectorMetadata
-
applyAggregation
public Optional<AggregationApplicationResult<ConnectorTableHandle>> applyAggregation(ConnectorSession session, ConnectorTableHandle table, List<AggregateFunction> aggregates, Map<String, ColumnHandle> assignments, List<List<ColumnHandle>> groupingSets) - Specified by:
applyAggregationin interfaceConnectorMetadata
-
applyJoin
public Optional<JoinApplicationResult<ConnectorTableHandle>> applyJoin(ConnectorSession session, JoinType joinType, ConnectorTableHandle left, ConnectorTableHandle right, List<JoinCondition> joinConditions, Map<String, ColumnHandle> leftAssignments, Map<String, ColumnHandle> rightAssignments, JoinStatistics statistics) - Specified by:
applyJoinin interfaceConnectorMetadata
-
applyLimit
public Optional<LimitApplicationResult<ConnectorTableHandle>> applyLimit(ConnectorSession session, ConnectorTableHandle table, long limit) - Specified by:
applyLimitin interfaceConnectorMetadata
-
applyTopN
public Optional<TopNApplicationResult<ConnectorTableHandle>> applyTopN(ConnectorSession session, ConnectorTableHandle table, long topNCount, List<SortItem> sortItems, Map<String, ColumnHandle> assignments) - Specified by:
applyTopNin interfaceConnectorMetadata
-
applyTableFunction
public Optional<TableFunctionApplicationResult<ConnectorTableHandle>> applyTableFunction(ConnectorSession session, ConnectorTableFunctionHandle handle) - Specified by:
applyTableFunctionin interfaceConnectorMetadata
-
applyTableScanRedirect
public Optional<TableScanRedirectApplicationResult> applyTableScanRedirect(ConnectorSession session, ConnectorTableHandle table) - Specified by:
applyTableScanRedirectin interfaceConnectorMetadata
-
getTableName
- Specified by:
getTableNamein interfaceConnectorMetadata
-
getTableSchema
- Specified by:
getTableSchemain interfaceConnectorMetadata
-
getTableMetadata
public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table) - Specified by:
getTableMetadatain interfaceConnectorMetadata
-
getTableComment
-
listTables
- Specified by:
listTablesin interfaceConnectorMetadata
-
getColumnHandles
public Map<String,ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle) - Specified by:
getColumnHandlesin interfaceConnectorMetadata
-
listTableColumns
public Map<SchemaTableName,List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix) - Specified by:
listTableColumnsin interfaceConnectorMetadata
-
getColumnMetadata
public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle) - Specified by:
getColumnMetadatain interfaceConnectorMetadata
-
dropTable
- Specified by:
dropTablein interfaceConnectorMetadata
-
beginCreateTable
public ConnectorOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorTableLayout> layout, RetryMode retryMode) - Specified by:
beginCreateTablein interfaceConnectorMetadata
-
createTable
public void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, boolean ignoreExisting) - Specified by:
createTablein interfaceConnectorMetadata
-
finishCreateTable
public Optional<ConnectorOutputMetadata> finishCreateTable(ConnectorSession session, ConnectorOutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics) - Specified by:
finishCreateTablein interfaceConnectorMetadata
-
beginQuery
- Specified by:
beginQueryin interfaceConnectorMetadata
-
cleanupQuery
- Specified by:
cleanupQueryin interfaceConnectorMetadata
-
rollback
public void rollback()- Specified by:
rollbackin interfaceJdbcMetadata
-
beginInsert
public ConnectorInsertTableHandle beginInsert(ConnectorSession session, ConnectorTableHandle tableHandle, List<ColumnHandle> columns, RetryMode retryMode) - Specified by:
beginInsertin interfaceConnectorMetadata
-
supportsMissingColumnsOnInsert
public boolean supportsMissingColumnsOnInsert()- Specified by:
supportsMissingColumnsOnInsertin interfaceConnectorMetadata
-
finishInsert
public Optional<ConnectorOutputMetadata> finishInsert(ConnectorSession session, ConnectorInsertTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics) - Specified by:
finishInsertin interfaceConnectorMetadata
-
getMergeRowIdColumnHandle
public ColumnHandle getMergeRowIdColumnHandle(ConnectorSession session, ConnectorTableHandle tableHandle) - Specified by:
getMergeRowIdColumnHandlein interfaceConnectorMetadata
-
applyDelete
public Optional<ConnectorTableHandle> applyDelete(ConnectorSession session, ConnectorTableHandle handle) - Specified by:
applyDeletein interfaceConnectorMetadata
-
executeDelete
- Specified by:
executeDeletein interfaceConnectorMetadata
-
truncateTable
- Specified by:
truncateTablein interfaceConnectorMetadata
-
setTableComment
public void setTableComment(ConnectorSession session, ConnectorTableHandle table, Optional<String> comment) - Specified by:
setTableCommentin interfaceConnectorMetadata
-
setColumnComment
public void setColumnComment(ConnectorSession session, ConnectorTableHandle table, ColumnHandle column, Optional<String> comment) - Specified by:
setColumnCommentin interfaceConnectorMetadata
-
addColumn
public void addColumn(ConnectorSession session, ConnectorTableHandle table, ColumnMetadata columnMetadata) - Specified by:
addColumnin interfaceConnectorMetadata
-
dropColumn
- Specified by:
dropColumnin interfaceConnectorMetadata
-
renameColumn
public void renameColumn(ConnectorSession session, ConnectorTableHandle table, ColumnHandle column, String target) - Specified by:
renameColumnin interfaceConnectorMetadata
-
setColumnType
public void setColumnType(ConnectorSession session, ConnectorTableHandle table, ColumnHandle column, Type type) - Specified by:
setColumnTypein interfaceConnectorMetadata
-
renameTable
public void renameTable(ConnectorSession session, ConnectorTableHandle table, SchemaTableName newTableName) - Specified by:
renameTablein interfaceConnectorMetadata
-
setTableProperties
public void setTableProperties(ConnectorSession session, ConnectorTableHandle table, Map<String, Optional<Object>> properties) - Specified by:
setTablePropertiesin interfaceConnectorMetadata
-
getTableStatistics
public TableStatistics getTableStatistics(ConnectorSession session, ConnectorTableHandle tableHandle) - Specified by:
getTableStatisticsin interfaceConnectorMetadata
-
createSchema
public void createSchema(ConnectorSession session, String schemaName, Map<String, Object> properties, TrinoPrincipal owner) - Specified by:
createSchemain interfaceConnectorMetadata
-
dropSchema
- Specified by:
dropSchemain interfaceConnectorMetadata
-
renameSchema
- Specified by:
renameSchemain interfaceConnectorMetadata
-