use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class MetadataManager method applySample.
@Override
public Optional<TableHandle> applySample(Session session, TableHandle table, SampleType sampleType, double sampleRatio) {
CatalogName catalogName = table.getCatalogName();
ConnectorMetadata metadata = getMetadata(session, catalogName);
if (metadata.usesLegacyTableLayouts()) {
return Optional.empty();
}
ConnectorSession connectorSession = session.toConnectorSession(catalogName);
return metadata.applySample(connectorSession, table.getConnectorHandle(), sampleType, sampleRatio).map(result -> new TableHandle(catalogName, result, table.getTransaction(), Optional.empty()));
}
use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class MetadataManager method renameSchema.
@Override
public void renameSchema(Session session, CatalogSchemaName source, String target) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, source.getCatalogName());
CatalogName catalogName = catalogMetadata.getCatalogName();
ConnectorMetadata metadata = catalogMetadata.getMetadata();
metadata.renameSchema(session.toConnectorSession(catalogName), source.getSchemaName(), target);
}
use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class MetadataManager method createView.
@Override
public void createView(Session session, QualifiedObjectName viewName, ConnectorViewDefinition definition, boolean replace) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, viewName.getCatalogName());
CatalogName catalogName = catalogMetadata.getCatalogName();
ConnectorMetadata metadata = catalogMetadata.getMetadata();
metadata.createView(session.toConnectorSession(catalogName), toSchemaTableName(viewName), definition, replace);
}
use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class MetadataManager method getStatisticsCollectionMetadata.
@Override
public TableStatisticsMetadata getStatisticsCollectionMetadata(Session session, String catalogName, ConnectorTableMetadata tableMetadata) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
ConnectorMetadata metadata = catalogMetadata.getMetadata();
CatalogName catalog = catalogMetadata.getCatalogName();
return metadata.getStatisticsCollectionMetadata(session.toConnectorSession(catalog), tableMetadata);
}
use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class MetadataManager method beginStatisticsCollection.
@Override
public AnalyzeTableHandle beginStatisticsCollection(Session session, TableHandle tableHandle) {
CatalogName catalogName = tableHandle.getCatalogName();
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
ConnectorMetadata metadata = catalogMetadata.getMetadata();
ConnectorTransactionHandle transactionHandle = catalogMetadata.getTransactionHandleFor(catalogName);
ConnectorTableHandle connectorTableHandle = metadata.beginStatisticsCollection(session.toConnectorSession(catalogName), tableHandle.getConnectorHandle());
return new AnalyzeTableHandle(catalogName, transactionHandle, connectorTableHandle);
}
Aggregations