Search in sources :

Example 1 with InsertReference

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

the class LogicalPlanner method createInsertPlan.

private RelationPlan createInsertPlan(Analysis analysis, Insert insertStatement) {
    Analysis.Insert insertAnalysis = analysis.getInsert().get();
    TableHandle tableHandle = insertAnalysis.getTarget();
    List<ColumnHandle> columnHandles = insertAnalysis.getColumns();
    WriterTarget target = new InsertReference(tableHandle, metadata.getTableMetadata(session, tableHandle).getTable());
    return buildInternalInsertPlan(tableHandle, columnHandles, insertStatement.getQuery(), analysis, target);
}
Also used : ColumnHandle(com.facebook.presto.spi.ColumnHandle) Analysis(com.facebook.presto.sql.analyzer.Analysis) TableHandle(com.facebook.presto.spi.TableHandle) WriterTarget(com.facebook.presto.sql.planner.plan.TableWriterNode.WriterTarget) InsertReference(com.facebook.presto.sql.planner.plan.TableWriterNode.InsertReference)

Aggregations

ColumnHandle (com.facebook.presto.spi.ColumnHandle)1 TableHandle (com.facebook.presto.spi.TableHandle)1 Analysis (com.facebook.presto.sql.analyzer.Analysis)1 InsertReference (com.facebook.presto.sql.planner.plan.TableWriterNode.InsertReference)1 WriterTarget (com.facebook.presto.sql.planner.plan.TableWriterNode.WriterTarget)1