Search in sources :

Example 6 with TableLayout

use of io.trino.metadata.TableLayout in project trino by trinodb.

the class LogicalPlanner method createInsertPlan.

private RelationPlan createInsertPlan(Analysis analysis, Insert insertStatement) {
    Analysis.Insert insert = analysis.getInsert().orElseThrow();
    TableHandle tableHandle = insert.getTarget();
    Query query = insertStatement.getQuery();
    Optional<TableLayout> newTableLayout = insert.getNewTableLayout();
    return getInsertPlan(analysis, insert.getTable(), query, tableHandle, insert.getColumns(), newTableLayout, Optional.empty());
}
Also used : Query(io.trino.sql.tree.Query) Analysis(io.trino.sql.analyzer.Analysis) TableHandle(io.trino.metadata.TableHandle) TableLayout(io.trino.metadata.TableLayout)

Aggregations

TableLayout (io.trino.metadata.TableLayout)6 MetadataUtil.createQualifiedObjectName (io.trino.metadata.MetadataUtil.createQualifiedObjectName)5 QualifiedObjectName (io.trino.metadata.QualifiedObjectName)5 TableHandle (io.trino.metadata.TableHandle)5 Analysis (io.trino.sql.analyzer.Analysis)5 ConnectorTableMetadata (io.trino.spi.connector.ConnectorTableMetadata)4 PlanNode (io.trino.sql.planner.plan.PlanNode)4 TableExecuteHandle (io.trino.metadata.TableExecuteHandle)3 TableMetadata (io.trino.metadata.TableMetadata)3 TableStatisticsMetadata (io.trino.spi.statistics.TableStatisticsMetadata)3 LimitNode (io.trino.sql.planner.plan.LimitNode)3 CreateReference (io.trino.sql.planner.plan.TableWriterNode.CreateReference)3 Preconditions.checkState (com.google.common.base.Preconditions.checkState)2 Verify.verify (com.google.common.base.Verify.verify)2 ImmutableList (com.google.common.collect.ImmutableList)2 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)2 ImmutableMap (com.google.common.collect.ImmutableMap)2 ImmutableMap.toImmutableMap (com.google.common.collect.ImmutableMap.toImmutableMap)2 ImmutableSet.toImmutableSet (com.google.common.collect.ImmutableSet.toImmutableSet)2 Streams.zip (com.google.common.collect.Streams.zip)2