public interface ConnectorMetadata
Modifier and Type | Method and Description |
---|---|
default void |
addColumn(ConnectorSession session,
ConnectorTableHandle tableHandle,
ColumnMetadata column)
Add the specified column
|
default ConnectorOutputTableHandle |
beginCreateTable(ConnectorSession session,
ConnectorTableMetadata tableMetadata,
Optional<ConnectorNewTableLayout> layout)
Begin the atomic creation of a table with data.
|
default ConnectorTableHandle |
beginDelete(ConnectorSession session,
ConnectorTableHandle tableHandle)
Begin delete query
|
default ConnectorInsertTableHandle |
beginInsert(ConnectorSession session,
ConnectorTableHandle tableHandle)
Begin insert query
|
default boolean |
canCreateSampledTables(ConnectorSession session)
Returns true if this catalog supports creation of sampled tables
|
default void |
createTable(ConnectorSession session,
ConnectorTableMetadata tableMetadata)
Creates a table using the specified table metadata.
|
default void |
createView(ConnectorSession session,
SchemaTableName viewName,
String viewData,
boolean replace)
Create the specified view.
|
default void |
dropTable(ConnectorSession session,
ConnectorTableHandle tableHandle)
Drops the specified table
|
default void |
dropView(ConnectorSession session,
SchemaTableName viewName)
Drop the specified view.
|
default void |
finishCreateTable(ConnectorSession session,
ConnectorOutputTableHandle tableHandle,
Collection<io.airlift.slice.Slice> fragments)
Finish a table creation with data after the data is written.
|
default void |
finishDelete(ConnectorSession session,
ConnectorTableHandle tableHandle,
Collection<io.airlift.slice.Slice> fragments)
Finish delete query
|
default void |
finishInsert(ConnectorSession session,
ConnectorInsertTableHandle insertHandle,
Collection<io.airlift.slice.Slice> fragments)
Finish insert query
|
Map<String,ColumnHandle> |
getColumnHandles(ConnectorSession session,
ConnectorTableHandle tableHandle)
Gets all of the columns on the specified table, or an empty map if the columns can not be enumerated.
|
ColumnMetadata |
getColumnMetadata(ConnectorSession session,
ConnectorTableHandle tableHandle,
ColumnHandle columnHandle)
Gets the metadata for the specified table column.
|
default Optional<ConnectorNewTableLayout> |
getNewTableLayout(ConnectorSession session,
ConnectorTableMetadata tableMetadata)
Get the physical layout for a new table.
|
default ColumnHandle |
getSampleWeightColumnHandle(ConnectorSession session,
ConnectorTableHandle tableHandle)
Returns the handle for the sample weight column, or null if the table does not contain sampled data.
|
ConnectorTableHandle |
getTableHandle(ConnectorSession session,
SchemaTableName tableName)
Returns a table handle for the specified table name, or null if the connector does not contain the table.
|
ConnectorTableLayout |
getTableLayout(ConnectorSession session,
ConnectorTableLayoutHandle handle) |
List<ConnectorTableLayoutResult> |
getTableLayouts(ConnectorSession session,
ConnectorTableHandle table,
Constraint<ColumnHandle> constraint,
Optional<Set<ColumnHandle>> desiredColumns)
Return a list of table layouts that satisfy the given constraint.
|
ConnectorTableMetadata |
getTableMetadata(ConnectorSession session,
ConnectorTableHandle table)
Return the metadata for the specified table handle.
|
default ColumnHandle |
getUpdateRowIdColumnHandle(ConnectorSession session,
ConnectorTableHandle tableHandle)
Get the column handle that will generate row IDs for the delete operation.
|
default Map<SchemaTableName,ConnectorViewDefinition> |
getViews(ConnectorSession session,
SchemaTablePrefix prefix)
Gets the view data for views that match the specified table prefix.
|
default void |
grantTablePrivileges(ConnectorSession session,
SchemaTableName tableName,
Set<Privilege> privileges,
String grantee,
boolean grantOption)
Grants the specified privilege to the specified user on the specified table
|
List<String> |
listSchemaNames(ConnectorSession session)
Returns the schemas provided by this connector.
|
Map<SchemaTableName,List<ColumnMetadata>> |
listTableColumns(ConnectorSession session,
SchemaTablePrefix prefix)
Gets the metadata for all columns that match the specified table prefix.
|
List<SchemaTableName> |
listTables(ConnectorSession session,
String schemaNameOrNull)
List table names, possibly filtered by schema.
|
default List<SchemaTableName> |
listViews(ConnectorSession session,
String schemaNameOrNull)
List view names, possibly filtered by schema.
|
default OptionalLong |
metadataDelete(ConnectorSession session,
ConnectorTableHandle tableHandle,
ConnectorTableLayoutHandle tableLayoutHandle)
Delete the provided table layout
|
default void |
renameColumn(ConnectorSession session,
ConnectorTableHandle tableHandle,
ColumnHandle source,
String target)
Rename the specified column
|
default void |
renameTable(ConnectorSession session,
ConnectorTableHandle tableHandle,
SchemaTableName newTableName)
Rename the specified table
|
default Optional<ConnectorResolvedIndex> |
resolveIndex(ConnectorSession session,
ConnectorTableHandle 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.
|
default boolean |
supportsMetadataDelete(ConnectorSession session,
ConnectorTableHandle tableHandle,
ConnectorTableLayoutHandle tableLayoutHandle) |
List<String> listSchemaNames(ConnectorSession session)
ConnectorTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)
List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
For each layout, connectors must return an "unenforced constraint" representing the part of the constraint summary that isn't guaranteed by the layout.
ConnectorTableLayout getTableLayout(ConnectorSession session, ConnectorTableLayoutHandle handle)
ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle table)
RuntimeException
- if table handle is no longer validList<SchemaTableName> listTables(ConnectorSession session, String schemaNameOrNull)
default ColumnHandle getSampleWeightColumnHandle(ConnectorSession session, ConnectorTableHandle tableHandle)
RuntimeException
- if the table handle is no longer validdefault boolean canCreateSampledTables(ConnectorSession session)
Map<String,ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle)
RuntimeException
- if table handle is no longer validColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle)
RuntimeException
- if table or column handles are no longer validMap<SchemaTableName,List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix)
default void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata)
default void dropTable(ConnectorSession session, ConnectorTableHandle tableHandle)
RuntimeException
- if the table can not be dropped or table handle is no longer validdefault void renameTable(ConnectorSession session, ConnectorTableHandle tableHandle, SchemaTableName newTableName)
default void addColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnMetadata column)
default void renameColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle source, String target)
default Optional<ConnectorNewTableLayout> getNewTableLayout(ConnectorSession session, ConnectorTableMetadata tableMetadata)
default ConnectorOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorNewTableLayout> layout)
default void finishCreateTable(ConnectorSession session, ConnectorOutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)
default ConnectorInsertTableHandle beginInsert(ConnectorSession session, ConnectorTableHandle tableHandle)
default void finishInsert(ConnectorSession session, ConnectorInsertTableHandle insertHandle, Collection<io.airlift.slice.Slice> fragments)
default ColumnHandle getUpdateRowIdColumnHandle(ConnectorSession session, ConnectorTableHandle tableHandle)
deleteRows()
method of the
UpdatablePageSource
that created them.default ConnectorTableHandle beginDelete(ConnectorSession session, ConnectorTableHandle tableHandle)
default void finishDelete(ConnectorSession session, ConnectorTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)
fragments
- all fragments returned by UpdatablePageSource.finish()
default void createView(ConnectorSession session, SchemaTableName viewName, String viewData, boolean replace)
default void dropView(ConnectorSession session, SchemaTableName viewName)
default List<SchemaTableName> listViews(ConnectorSession session, String schemaNameOrNull)
default Map<SchemaTableName,ConnectorViewDefinition> getViews(ConnectorSession session, SchemaTablePrefix prefix)
default boolean supportsMetadataDelete(ConnectorSession session, ConnectorTableHandle tableHandle, ConnectorTableLayoutHandle tableLayoutHandle)
default OptionalLong metadataDelete(ConnectorSession session, ConnectorTableHandle tableHandle, ConnectorTableLayoutHandle tableLayoutHandle)
default Optional<ConnectorResolvedIndex> resolveIndex(ConnectorSession session, ConnectorTableHandle tableHandle, Set<ColumnHandle> indexableColumns, Set<ColumnHandle> outputColumns, TupleDomain<ColumnHandle> tupleDomain)
default void grantTablePrivileges(ConnectorSession session, SchemaTableName tableName, Set<Privilege> privileges, String grantee, boolean grantOption)
Copyright © 2012-2016. All Rights Reserved.