Search in sources :

Example 21 with ConnectorMetadata

use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.

the class MetadataManager method dropView.

@Override
public void dropView(Session session, QualifiedObjectName viewName) {
    CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, viewName.getCatalogName());
    CatalogName catalogName = catalogMetadata.getCatalogName();
    ConnectorMetadata metadata = catalogMetadata.getMetadata();
    metadata.dropView(session.toConnectorSession(catalogName), toSchemaTableName(viewName));
}
Also used : CatalogName(io.prestosql.spi.connector.CatalogName) ConnectorMetadata(io.prestosql.spi.connector.ConnectorMetadata)

Example 22 with ConnectorMetadata

use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.

the class MetadataManager method getUpdateRowIdColumnHandle.

@Override
public ColumnHandle getUpdateRowIdColumnHandle(Session session, TableHandle tableHandle, List<ColumnHandle> updatedColumns) {
    CatalogName catalogName = tableHandle.getCatalogName();
    ConnectorMetadata metadata = getMetadata(session, catalogName);
    return metadata.getUpdateRowIdColumnHandle(session.toConnectorSession(catalogName), tableHandle.getConnectorHandle(), updatedColumns);
}
Also used : CatalogName(io.prestosql.spi.connector.CatalogName) ConnectorMetadata(io.prestosql.spi.connector.ConnectorMetadata)

Example 23 with ConnectorMetadata

use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.

the class MetadataManager method listEnabledRoles.

@Override
public Set<String> listEnabledRoles(Session session, String catalog) {
    Optional<CatalogMetadata> catalogMetadata = getOptionalCatalogMetadata(session, catalog);
    if (!catalogMetadata.isPresent()) {
        return ImmutableSet.of();
    }
    CatalogName catalogName = catalogMetadata.get().getCatalogName();
    ConnectorSession connectorSession = session.toConnectorSession(catalogName);
    ConnectorMetadata metadata = catalogMetadata.get().getMetadataFor(catalogName);
    return ImmutableSet.copyOf(metadata.listEnabledRoles(connectorSession));
}
Also used : CatalogName(io.prestosql.spi.connector.CatalogName) ConnectorSession(io.prestosql.spi.connector.ConnectorSession) ConnectorMetadata(io.prestosql.spi.connector.ConnectorMetadata)

Example 24 with ConnectorMetadata

use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.

the class MetadataManager method validateAndGetSortAggregationType.

@Override
public PartialAndFinalAggregationType validateAndGetSortAggregationType(Session session, TableHandle tableHandle, List<String> keyNames) {
    CatalogName catalogName = tableHandle.getCatalogName();
    ConnectorMetadata metadata = getMetadata(session, catalogName);
    return metadata.validateAndGetSortAggregationType(session.toConnectorSession(catalogName), tableHandle.getConnectorHandle(), keyNames);
}
Also used : CatalogName(io.prestosql.spi.connector.CatalogName) ConnectorMetadata(io.prestosql.spi.connector.ConnectorMetadata)

Example 25 with ConnectorMetadata

use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.

the class MetadataManager method dropRole.

@Override
public void dropRole(Session session, String role, String catalog) {
    CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalog);
    CatalogName catalogName = catalogMetadata.getCatalogName();
    ConnectorMetadata metadata = catalogMetadata.getMetadata();
    metadata.dropRole(session.toConnectorSession(catalogName), role);
}
Also used : CatalogName(io.prestosql.spi.connector.CatalogName) ConnectorMetadata(io.prestosql.spi.connector.ConnectorMetadata)

Aggregations

ConnectorMetadata (io.prestosql.spi.connector.ConnectorMetadata)235 ConnectorSession (io.prestosql.spi.connector.ConnectorSession)126 Test (org.testng.annotations.Test)109 ConnectorTableHandle (io.prestosql.spi.connector.ConnectorTableHandle)103 TestingConnectorSession (io.prestosql.testing.TestingConnectorSession)96 CatalogName (io.prestosql.spi.connector.CatalogName)80 SchemaTableName (io.prestosql.spi.connector.SchemaTableName)63 ColumnHandle (io.prestosql.spi.connector.ColumnHandle)53 ConnectorTableMetadata (io.prestosql.spi.connector.ConnectorTableMetadata)52 HiveColumnHandle.bucketColumnHandle (io.prestosql.plugin.hive.HiveColumnHandle.bucketColumnHandle)44 ColumnMetadata (io.prestosql.spi.connector.ColumnMetadata)42 MaterializedResult (io.prestosql.testing.MaterializedResult)42 ConnectorInsertTableHandle (io.prestosql.spi.connector.ConnectorInsertTableHandle)41 ConnectorOutputTableHandle (io.prestosql.spi.connector.ConnectorOutputTableHandle)37 Constraint (io.prestosql.spi.connector.Constraint)35 Slice (io.airlift.slice.Slice)32 Path (org.apache.hadoop.fs.Path)32 PrestoException (io.prestosql.spi.PrestoException)31 HdfsContext (io.prestosql.plugin.hive.HdfsEnvironment.HdfsContext)30 ConnectorPageSink (io.prestosql.spi.connector.ConnectorPageSink)30