Search in sources :

Example 1 with CreateName

use of com.facebook.presto.sql.planner.plan.TableWriterNode.CreateName in project presto by prestodb.

the class LogicalPlanner method createTableCreationPlan.

private RelationPlan createTableCreationPlan(Analysis analysis, Query query) {
    QualifiedObjectName destination = analysis.getCreateTableDestination().get();
    RelationPlan plan = createRelationPlan(analysis, query);
    ConnectorTableMetadata tableMetadata = createTableMetadata(destination, getOutputTableColumns(plan), analysis.getCreateTableProperties(), analysis.getParameters());
    Optional<NewTableLayout> newTableLayout = metadata.getNewTableLayout(session, destination.getCatalogName(), tableMetadata);
    List<String> columnNames = tableMetadata.getColumns().stream().filter(column -> !column.isHidden()).map(ColumnMetadata::getName).collect(toImmutableList());
    return createTableWriterPlan(analysis, plan, new CreateName(destination.getCatalogName(), tableMetadata, newTableLayout), columnNames, newTableLayout);
}
Also used : NewTableLayout(com.facebook.presto.metadata.NewTableLayout) CreateName(com.facebook.presto.sql.planner.plan.TableWriterNode.CreateName) QualifiedObjectName(com.facebook.presto.metadata.QualifiedObjectName) ConnectorTableMetadata(com.facebook.presto.spi.ConnectorTableMetadata)

Aggregations

NewTableLayout (com.facebook.presto.metadata.NewTableLayout)1 QualifiedObjectName (com.facebook.presto.metadata.QualifiedObjectName)1 ConnectorTableMetadata (com.facebook.presto.spi.ConnectorTableMetadata)1 CreateName (com.facebook.presto.sql.planner.plan.TableWriterNode.CreateName)1