public interface Metadata
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(Session session,
TableHandle tableHandle,
ColumnMetadata column)
Add the specified column to the table.
|
void |
addFunctions(List<? extends SqlFunction> functions) |
Optional<ConstraintApplicationResult<TableHandle>> |
applyFilter(Session session,
TableHandle table,
Constraint constraint) |
Optional<LimitApplicationResult<TableHandle>> |
applyLimit(Session session,
TableHandle table,
long limit) |
Optional<TableHandle> |
applySample(Session session,
TableHandle table,
SampleType sampleType,
double sampleRatio) |
OutputTableHandle |
beginCreateTable(Session session,
String catalogName,
ConnectorTableMetadata tableMetadata,
Optional<NewTableLayout> layout)
Begin the atomic creation of a table with data.
|
TableHandle |
beginDelete(Session session,
TableHandle tableHandle)
Begin delete query
|
InsertTableHandle |
beginInsert(Session session,
TableHandle tableHandle)
Begin insert query
|
void |
beginQuery(Session session,
Set<CatalogName> connectors)
Start a SELECT/UPDATE/INSERT/DELETE query
|
AnalyzeTableHandle |
beginStatisticsCollection(Session session,
TableHandle tableHandle)
Begin statistics collection
|
boolean |
catalogExists(Session session,
String catalogName) |
void |
cleanupQuery(Session session)
Cleanup after a query.
|
void |
createRole(Session session,
String role,
Optional<PrestoPrincipal> grantor,
String catalog)
Creates the specified role in the specified catalog.
|
void |
createSchema(Session session,
CatalogSchemaName schema,
Map<String,Object> properties)
Creates a schema.
|
void |
createTable(Session session,
String catalogName,
ConnectorTableMetadata tableMetadata,
boolean ignoreExisting)
Creates a table using the specified table metadata.
|
void |
createView(Session session,
QualifiedObjectName viewName,
String viewData,
boolean replace)
Creates the specified view with the specified view definition.
|
void |
dropColumn(Session session,
TableHandle tableHandle,
ColumnHandle column)
Drop the specified column.
|
void |
dropRole(Session session,
String role,
String catalog)
Drops the specified role in the specified catalog.
|
void |
dropSchema(Session session,
CatalogSchemaName schema)
Drops the specified schema.
|
void |
dropTable(Session session,
TableHandle tableHandle)
Drops the specified table
|
void |
dropView(Session session,
QualifiedObjectName viewName)
Drops the specified view.
|
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.
|
void |
finishDelete(Session session,
TableHandle tableHandle,
Collection<io.airlift.slice.Slice> fragments)
Finish delete query
|
Optional<ConnectorOutputMetadata> |
finishInsert(Session session,
InsertTableHandle tableHandle,
Collection<io.airlift.slice.Slice> fragments,
Collection<ComputedStatistics> computedStatistics)
Finish insert query
|
void |
finishStatisticsCollection(Session session,
AnalyzeTableHandle tableHandle,
Collection<ComputedStatistics> computedStatistics)
Finish statistics collection
|
AnalyzePropertyManager |
getAnalyzePropertyManager() |
BlockEncodingSerde |
getBlockEncodingSerde() |
Optional<CatalogName> |
getCatalogHandle(Session session,
String catalogName)
Returns a connector id for the specified catalog name.
|
Map<String,CatalogName> |
getCatalogNames(Session session)
Gets all the loaded catalogs
|
Map<String,ColumnHandle> |
getColumnHandles(Session session,
TableHandle tableHandle)
Gets all of the columns on the specified table, or an empty map if the columns can not be enumerated.
|
ColumnMetadata |
getColumnMetadata(Session session,
TableHandle tableHandle,
ColumnHandle columnHandle)
Gets the metadata for the specified table column.
|
ColumnPropertyManager |
getColumnPropertyManager() |
Optional<PartitioningHandle> |
getCommonPartitioning(Session session,
PartitioningHandle left,
PartitioningHandle right)
Return a partitioning handle which the connector can transparently convert both
left and right into. |
Set<ConnectorCapabilities> |
getConnectorCapabilities(Session session,
CatalogName catalogName) |
FunctionRegistry |
getFunctionRegistry() |
Optional<Object> |
getInfo(Session session,
TableHandle handle) |
Optional<NewTableLayout> |
getInsertLayout(Session session,
TableHandle target) |
Optional<TableLayoutResult> |
getLayout(Session session,
TableHandle tableHandle,
Constraint constraint,
Optional<Set<ColumnHandle>> desiredColumns)
Deprecated.
|
Optional<NewTableLayout> |
getNewTableLayout(Session session,
String catalogName,
ConnectorTableMetadata tableMetadata) |
ProcedureRegistry |
getProcedureRegistry() |
SchemaPropertyManager |
getSchemaPropertyManager() |
SessionPropertyManager |
getSessionPropertyManager() |
TableStatisticsMetadata |
getStatisticsCollectionMetadata(Session session,
String catalogName,
ConnectorTableMetadata tableMetadata)
Describe statistics that must be collected during a statistics collection
|
TableStatisticsMetadata |
getStatisticsCollectionMetadataForWrite(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 tableName)
Returns a table handle for the specified table name.
|
Optional<TableHandle> |
getTableHandleForStatisticsCollection(Session session,
QualifiedObjectName tableName,
Map<String,Object> analyzeProperties) |
TableMetadata |
getTableMetadata(Session session,
TableHandle tableHandle)
Return the metadata for the specified table handle.
|
TableProperties |
getTableProperties(Session session,
TableHandle handle) |
TablePropertyManager |
getTablePropertyManager() |
TableStatistics |
getTableStatistics(Session session,
TableHandle tableHandle,
Constraint constraint)
Return statistics for specified table for given filtering contraint.
|
Type |
getType(TypeSignature signature) |
TypeManager |
getTypeManager() |
ColumnHandle |
getUpdateRowIdColumnHandle(Session session,
TableHandle tableHandle)
Get the row ID column handle used with UpdatablePageSource.
|
Optional<ViewDefinition> |
getView(Session session,
QualifiedObjectName viewName)
Returns the view definition for the specified view name.
|
Map<QualifiedObjectName,ViewDefinition> |
getViews(Session session,
QualifiedTablePrefix prefix)
Get the view definitions that match the specified table prefix (never null).
|
void |
grantRoles(Session session,
Set<String> roles,
Set<PrestoPrincipal> grantees,
boolean withAdminOption,
Optional<PrestoPrincipal> grantor,
String catalog)
Grants the specified roles to the specified grantees in the specified catalog
|
void |
grantTablePrivileges(Session session,
QualifiedObjectName tableName,
Set<Privilege> privileges,
PrestoPrincipal grantee,
boolean grantOption)
Grants the specified privilege to the specified user on the specified table
|
boolean |
isAggregationFunction(QualifiedName name) |
Set<RoleGrant> |
listApplicableRoles(Session session,
PrestoPrincipal principal,
String catalog)
List applicable roles, including the transitive grants, for the specified principal
|
Set<String> |
listEnabledRoles(Session session,
String catalog)
List applicable roles, including the transitive grants, in given session
|
List<SqlFunction> |
listFunctions() |
Set<RoleGrant> |
listRoleGrants(Session session,
String catalog,
PrestoPrincipal principal)
List roles grants in the specified catalog for a given principal, not recursively.
|
Set<String> |
listRoles(Session session,
String catalog)
List available roles in specified catalog.
|
List<String> |
listSchemaNames(Session session,
String catalogName) |
Map<QualifiedObjectName,List<ColumnMetadata>> |
listTableColumns(Session session,
QualifiedTablePrefix prefix)
Gets the metadata for all columns that match the specified table prefix.
|
List<GrantInfo> |
listTablePrivileges(Session session,
QualifiedTablePrefix prefix)
Gets the privileges for the specified table available to the given grantee considering the selected session role
|
List<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).
|
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.
|
OptionalLong |
metadataDelete(Session session,
TableHandle tableHandle)
Delete the provide table layout
|
void |
renameColumn(Session session,
TableHandle tableHandle,
ColumnHandle source,
String target)
Rename the specified column.
|
void |
renameSchema(Session session,
CatalogSchemaName source,
String target)
Renames the specified schema.
|
void |
renameTable(Session session,
TableHandle tableHandle,
QualifiedObjectName newTableName)
Rename the specified table.
|
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.
|
void |
revokeRoles(Session session,
Set<String> roles,
Set<PrestoPrincipal> grantees,
boolean adminOptionFor,
Optional<PrestoPrincipal> grantor,
String catalog)
Revokes the specified roles from the specified grantees in the specified catalog
|
void |
revokeTablePrivileges(Session session,
QualifiedObjectName tableName,
Set<Privilege> privileges,
PrestoPrincipal grantee,
boolean grantOption)
Revokes the specified privilege on the specified table from the specified user
|
boolean |
schemaExists(Session session,
CatalogSchemaName schema) |
void |
setTableComment(Session session,
TableHandle tableHandle,
Optional<String> comment)
Comments to the specified table.
|
boolean |
supportsMetadataDelete(Session session,
TableHandle tableHandle) |
boolean |
usesLegacyTableLayouts(Session session,
TableHandle table)
Deprecated.
|
void |
verifyComparableOrderableContract() |
void verifyComparableOrderableContract()
Type getType(TypeSignature signature)
boolean isAggregationFunction(QualifiedName name)
List<SqlFunction> listFunctions()
void addFunctions(List<? extends SqlFunction> functions)
boolean schemaExists(Session session, CatalogSchemaName schema)
Optional<TableHandle> getTableHandle(Session session, QualifiedObjectName tableName)
Optional<SystemTable> getSystemTable(Session session, QualifiedObjectName tableName)
Optional<TableHandle> getTableHandleForStatisticsCollection(Session session, QualifiedObjectName tableName, Map<String,Object> analyzeProperties)
@Deprecated Optional<TableLayoutResult> getLayout(Session session, TableHandle tableHandle, Constraint constraint, Optional<Set<ColumnHandle>> desiredColumns)
TableProperties getTableProperties(Session session, TableHandle handle)
TableHandle makeCompatiblePartitioning(Session session, TableHandle table, PartitioningHandle partitioningHandle)
getCommonPartitioning(io.prestosql.Session, io.prestosql.sql.planner.PartitioningHandle, io.prestosql.sql.planner.PartitioningHandle).Optional<PartitioningHandle> getCommonPartitioning(Session session, PartitioningHandle left, PartitioningHandle right)
left and right into.Optional<Object> getInfo(Session session, TableHandle handle)
TableMetadata getTableMetadata(Session session, TableHandle tableHandle)
RuntimeException - if table handle is no longer validTableStatistics getTableStatistics(Session session, TableHandle tableHandle, Constraint constraint)
List<QualifiedObjectName> listTables(Session session, QualifiedTablePrefix prefix)
Map<String,ColumnHandle> getColumnHandles(Session session, TableHandle tableHandle)
RuntimeException - if table handle is no longer validColumnMetadata getColumnMetadata(Session session, TableHandle tableHandle, ColumnHandle columnHandle)
RuntimeException - if table or column handles are no longer validMap<QualifiedObjectName,List<ColumnMetadata>> listTableColumns(Session session, QualifiedTablePrefix prefix)
void createSchema(Session session, CatalogSchemaName schema, Map<String,Object> properties)
void dropSchema(Session session, CatalogSchemaName schema)
void renameSchema(Session session, CatalogSchemaName source, String target)
void createTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, boolean ignoreExisting)
PrestoException - with ALREADY_EXISTS if the table already exists and is not setvoid renameTable(Session session, TableHandle tableHandle, QualifiedObjectName newTableName)
void setTableComment(Session session, TableHandle tableHandle, Optional<String> comment)
void renameColumn(Session session, TableHandle tableHandle, ColumnHandle source, String target)
void addColumn(Session session, TableHandle tableHandle, ColumnMetadata column)
void dropColumn(Session session, TableHandle tableHandle, ColumnHandle column)
void dropTable(Session session, TableHandle tableHandle)
RuntimeException - if the table can not be dropped or table handle is no longer validOptional<NewTableLayout> getNewTableLayout(Session session, String catalogName, ConnectorTableMetadata tableMetadata)
OutputTableHandle beginCreateTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, Optional<NewTableLayout> layout)
Optional<ConnectorOutputMetadata> finishCreateTable(Session session, OutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)
Optional<NewTableLayout> getInsertLayout(Session session, TableHandle target)
TableStatisticsMetadata getStatisticsCollectionMetadataForWrite(Session session, String catalogName, ConnectorTableMetadata tableMetadata)
TableStatisticsMetadata getStatisticsCollectionMetadata(Session session, String catalogName, ConnectorTableMetadata tableMetadata)
AnalyzeTableHandle beginStatisticsCollection(Session session, TableHandle tableHandle)
void finishStatisticsCollection(Session session, AnalyzeTableHandle tableHandle, Collection<ComputedStatistics> computedStatistics)
void beginQuery(Session session, Set<CatalogName> connectors)
void cleanupQuery(Session session)
InsertTableHandle beginInsert(Session session, TableHandle tableHandle)
Optional<ConnectorOutputMetadata> finishInsert(Session session, InsertTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)
ColumnHandle getUpdateRowIdColumnHandle(Session session, TableHandle tableHandle)
boolean supportsMetadataDelete(Session session, TableHandle tableHandle)
OptionalLong metadataDelete(Session session, TableHandle tableHandle)
TableHandle beginDelete(Session session, TableHandle tableHandle)
void finishDelete(Session session, TableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)
Optional<CatalogName> getCatalogHandle(Session session, String catalogName)
Map<String,CatalogName> getCatalogNames(Session session)
List<QualifiedObjectName> listViews(Session session, QualifiedTablePrefix prefix)
Map<QualifiedObjectName,ViewDefinition> getViews(Session session, QualifiedTablePrefix prefix)
Optional<ViewDefinition> getView(Session session, QualifiedObjectName viewName)
void createView(Session session, QualifiedObjectName viewName, String viewData, boolean replace)
void dropView(Session session, QualifiedObjectName viewName)
Optional<ResolvedIndex> resolveIndex(Session session, TableHandle tableHandle, Set<ColumnHandle> indexableColumns, Set<ColumnHandle> outputColumns, TupleDomain<ColumnHandle> tupleDomain)
void createRole(Session session, String role, Optional<PrestoPrincipal> grantor, String catalog)
grantor - represents the principal specified by WITH ADMIN statementvoid dropRole(Session session, String role, String catalog)
Set<String> listRoles(Session session, String catalog)
Set<RoleGrant> listRoleGrants(Session session, String catalog, PrestoPrincipal principal)
void grantRoles(Session session, Set<String> roles, Set<PrestoPrincipal> grantees, boolean withAdminOption, Optional<PrestoPrincipal> grantor, String catalog)
grantor - represents the principal specified by GRANTED BY statementvoid revokeRoles(Session session, Set<String> roles, Set<PrestoPrincipal> grantees, boolean adminOptionFor, Optional<PrestoPrincipal> grantor, String catalog)
grantor - represents the principal specified by GRANTED BY statementSet<RoleGrant> listApplicableRoles(Session session, PrestoPrincipal principal, String catalog)
Set<String> listEnabledRoles(Session session, String catalog)
void grantTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, PrestoPrincipal grantee, boolean grantOption)
void revokeTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, PrestoPrincipal grantee, boolean grantOption)
List<GrantInfo> listTablePrivileges(Session session, QualifiedTablePrefix prefix)
FunctionRegistry getFunctionRegistry()
ProcedureRegistry getProcedureRegistry()
TypeManager getTypeManager()
BlockEncodingSerde getBlockEncodingSerde()
SessionPropertyManager getSessionPropertyManager()
SchemaPropertyManager getSchemaPropertyManager()
TablePropertyManager getTablePropertyManager()
ColumnPropertyManager getColumnPropertyManager()
AnalyzePropertyManager getAnalyzePropertyManager()
Set<ConnectorCapabilities> getConnectorCapabilities(Session session, CatalogName catalogName)
@Deprecated boolean usesLegacyTableLayouts(Session session, TableHandle table)
Optional<LimitApplicationResult<TableHandle>> applyLimit(Session session, TableHandle table, long limit)
Optional<ConstraintApplicationResult<TableHandle>> applyFilter(Session session, TableHandle table, Constraint constraint)
Optional<TableHandle> applySample(Session session, TableHandle table, SampleType sampleType, double sampleRatio)
Copyright © 2012–2019. All rights reserved.