Package io.trino.plugin.jdbc
Class JdbcMetadata
- java.lang.Object
-
- io.trino.plugin.jdbc.JdbcMetadata
-
- All Implemented Interfaces:
ConnectorMetadata
public class JdbcMetadata extends Object implements ConnectorMetadata
-
-
Constructor Summary
Constructors Constructor Description JdbcMetadata(JdbcClient jdbcClient, boolean allowDropTable)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.trino.spi.connector.ConnectorMetadata
applyDelete, applyJoin, applySample, applyTopN, beginDelete, beginInsert, beginQuery, beginRefreshMaterializedView, beginStatisticsCollection, beginUpdate, cleanupQuery, createMaterializedView, createRole, createView, dropMaterializedView, dropRole, dropView, executeDelete, finishDelete, finishRefreshMaterializedView, finishStatisticsCollection, finishUpdate, getCommonPartitioningHandle, getDeleteRowIdColumnHandle, getInfo, getInfo, getInsertLayout, getMaterializedView, getMaterializedViewFreshness, getNewTableLayout, getSchemaOwner, getSchemaProperties, getStatisticsCollectionMetadata, getStatisticsCollectionMetadataForWrite, getTableHandleForStatisticsCollection, getTableLayout, getTableLayouts, getUpdateRowIdColumnHandle, getView, getViews, grantRoles, grantSchemaPrivileges, grantTablePrivileges, listAllRoleGrants, listApplicableRoles, listEnabledRoles, listRoleGrants, listRoles, listTablePrivileges, listViews, makeCompatiblePartitioning, makeCompatiblePartitioning, metadataDelete, renameSchema, renameView, resolveIndex, revokeRoles, revokeSchemaPrivileges, revokeTablePrivileges, setSchemaAuthorization, setTableAuthorization, setTableComment, setViewAuthorization, supportsMetadataDelete, validateScan
-
-
-
-
Constructor Detail
-
JdbcMetadata
public JdbcMetadata(JdbcClient jdbcClient, boolean allowDropTable)
-
-
Method Detail
-
schemaExists
public boolean schemaExists(ConnectorSession session, String schemaName)
- Specified by:
schemaExistsin interfaceConnectorMetadata
-
listSchemaNames
public List<String> listSchemaNames(ConnectorSession session)
- Specified by:
listSchemaNamesin interfaceConnectorMetadata
-
getTableHandle
public JdbcTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)
- Specified by:
getTableHandlein interfaceConnectorMetadata
-
getSystemTable
public Optional<SystemTable> getSystemTable(ConnectorSession session, SchemaTableName tableName)
- 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
-
applyLimit
public Optional<LimitApplicationResult<ConnectorTableHandle>> applyLimit(ConnectorSession session, ConnectorTableHandle table, long limit)
- Specified by:
applyLimitin interfaceConnectorMetadata
-
applyTableScanRedirect
public Optional<TableScanRedirectApplicationResult> applyTableScanRedirect(ConnectorSession session, ConnectorTableHandle table)
- Specified by:
applyTableScanRedirectin interfaceConnectorMetadata
-
usesLegacyTableLayouts
public boolean usesLegacyTableLayouts()
- Specified by:
usesLegacyTableLayoutsin interfaceConnectorMetadata
-
getTableProperties
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
- Specified by:
getTablePropertiesin interfaceConnectorMetadata
-
getTableMetadata
public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table)
- Specified by:
getTableMetadatain interfaceConnectorMetadata
-
listTables
public List<SchemaTableName> listTables(ConnectorSession session, Optional<String> schemaName)
- 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
public void dropTable(ConnectorSession session, ConnectorTableHandle tableHandle)
- Specified by:
dropTablein interfaceConnectorMetadata
-
beginCreateTable
public ConnectorOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorNewTableLayout> layout)
- 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
-
rollback
public void rollback()
-
beginInsert
public ConnectorInsertTableHandle beginInsert(ConnectorSession session, ConnectorTableHandle tableHandle, List<ColumnHandle> columns)
- 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
-
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
public void dropColumn(ConnectorSession session, ConnectorTableHandle table, ColumnHandle column)
- Specified by:
dropColumnin interfaceConnectorMetadata
-
renameColumn
public void renameColumn(ConnectorSession session, ConnectorTableHandle table, ColumnHandle column, String target)
- Specified by:
renameColumnin interfaceConnectorMetadata
-
renameTable
public void renameTable(ConnectorSession session, ConnectorTableHandle table, SchemaTableName newTableName)
- Specified by:
renameTablein interfaceConnectorMetadata
-
getTableStatistics
public TableStatistics getTableStatistics(ConnectorSession session, ConnectorTableHandle tableHandle, Constraint constraint)
- Specified by:
getTableStatisticsin interfaceConnectorMetadata
-
createSchema
public void createSchema(ConnectorSession session, String schemaName, Map<String,Object> properties, TrinoPrincipal owner)
- Specified by:
createSchemain interfaceConnectorMetadata
-
dropSchema
public void dropSchema(ConnectorSession session, String schemaName)
- Specified by:
dropSchemain interfaceConnectorMetadata
-
-