Search in sources :

Example 6 with ConnectorOutputTableHandle

use of com.facebook.presto.spi.ConnectorOutputTableHandle in project presto by prestodb.

the class BlackHoleMetadata method createTable.

@Override
public void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, boolean ignoreExisting) {
    ConnectorOutputTableHandle outputTableHandle = beginCreateTable(session, tableMetadata, Optional.empty());
    finishCreateTable(session, outputTableHandle, ImmutableList.of(), ImmutableList.of());
}
Also used : ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle)

Example 7 with ConnectorOutputTableHandle

use of com.facebook.presto.spi.ConnectorOutputTableHandle in project presto by prestodb.

the class TestTableWriterOperator method createTableWriterOperator.

private Operator createTableWriterOperator(PageSinkManager pageSinkManager, OperatorFactory statisticsAggregation, List<Type> outputTypes, Session session, TaskMetadataContext taskMetadataContext, DriverContext driverContext) {
    List<String> notNullColumnNames = new ArrayList<>(1);
    notNullColumnNames.add(null);
    TableWriterOperatorFactory factory = new TableWriterOperatorFactory(0, new PlanNodeId("test"), pageSinkManager, new ConnectorMetadataUpdaterManager(), taskMetadataContext, new CreateHandle(new OutputTableHandle(CONNECTOR_ID, new ConnectorTransactionHandle() {
    }, new ConnectorOutputTableHandle() {
    }), new SchemaTableName("testSchema", "testTable")), ImmutableList.of(0), notNullColumnNames, session, statisticsAggregation, outputTypes, TABLE_COMMIT_CONTEXT_CODEC, NO_COMMIT);
    return factory.createOperator(driverContext);
}
Also used : PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) TableWriterOperatorFactory(com.facebook.presto.operator.TableWriterOperator.TableWriterOperatorFactory) OutputTableHandle(com.facebook.presto.metadata.OutputTableHandle) ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle) ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle) CreateHandle(com.facebook.presto.execution.scheduler.ExecutionWriterTarget.CreateHandle) ArrayList(java.util.ArrayList) ConnectorTransactionHandle(com.facebook.presto.spi.connector.ConnectorTransactionHandle) ConnectorMetadataUpdaterManager(com.facebook.presto.metadata.ConnectorMetadataUpdaterManager) SchemaTableName(com.facebook.presto.spi.SchemaTableName)

Example 8 with ConnectorOutputTableHandle

use of com.facebook.presto.spi.ConnectorOutputTableHandle in project presto by prestodb.

the class MemoryMetadata method createTable.

@Override
public synchronized void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, boolean ignoreExisting) {
    ConnectorOutputTableHandle outputTableHandle = beginCreateTable(session, tableMetadata, Optional.empty());
    finishCreateTable(session, outputTableHandle, ImmutableList.of(), ImmutableList.of());
}
Also used : ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle)

Example 9 with ConnectorOutputTableHandle

use of com.facebook.presto.spi.ConnectorOutputTableHandle in project presto by prestodb.

the class MemoryMetadata method createTable.

@Override
public synchronized void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata) {
    ConnectorOutputTableHandle outputTableHandle = beginCreateTable(session, tableMetadata, Optional.empty());
    finishCreateTable(session, outputTableHandle, ImmutableList.of());
}
Also used : ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle)

Example 10 with ConnectorOutputTableHandle

use of com.facebook.presto.spi.ConnectorOutputTableHandle in project presto by prestodb.

the class BlackHoleMetadata method createTable.

@Override
public void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata) {
    ConnectorOutputTableHandle outputTableHandle = beginCreateTable(session, tableMetadata, Optional.empty());
    finishCreateTable(session, outputTableHandle, ImmutableList.of());
}
Also used : ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle)

Aggregations

ConnectorOutputTableHandle (com.facebook.presto.spi.ConnectorOutputTableHandle)18 ConnectorTableMetadata (com.facebook.presto.spi.ConnectorTableMetadata)10 Test (org.testng.annotations.Test)8 ConnectorTableHandle (com.facebook.presto.spi.ConnectorTableHandle)7 SchemaTableName (com.facebook.presto.spi.SchemaTableName)7 ConnectorSession (com.facebook.presto.spi.ConnectorSession)6 ConnectorMetadata (com.facebook.presto.spi.connector.ConnectorMetadata)5 ColumnHandle (com.facebook.presto.spi.ColumnHandle)4 ColumnMetadata (com.facebook.presto.spi.ColumnMetadata)4 ConnectorTableLayoutResult (com.facebook.presto.spi.ConnectorTableLayoutResult)4 TestingConnectorSession (com.facebook.presto.testing.TestingConnectorSession)4 Slice (io.airlift.slice.Slice)4 Table (com.facebook.presto.hive.metastore.Table)3 ConnectorPageSink (com.facebook.presto.spi.ConnectorPageSink)3 ConnectorTransactionHandle (com.facebook.presto.spi.connector.ConnectorTransactionHandle)3 MaterializedResult (com.facebook.presto.testing.MaterializedResult)3 Path (org.apache.hadoop.fs.Path)3 Database (com.facebook.presto.hive.metastore.Database)2 PrincipalPrivileges (com.facebook.presto.hive.metastore.PrincipalPrivileges)2 Constraint (com.facebook.presto.spi.Constraint)2