Search in sources :

Example 1 with RefreshMaterializedViewReference

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

the class LogicalPlanner method createRefreshMaterializedViewPlan.

private RelationPlan createRefreshMaterializedViewPlan(Analysis analysis, RefreshMaterializedView refreshMaterializedViewStatement) {
    Analysis.RefreshMaterializedViewAnalysis viewAnalysis = analysis.getRefreshMaterializedViewAnalysis().get();
    TableHandle tableHandle = viewAnalysis.getTarget();
    List<ColumnHandle> columnHandles = viewAnalysis.getColumns();
    WriterTarget target = new RefreshMaterializedViewReference(tableHandle, metadata.getTableMetadata(session, tableHandle).getTable());
    return buildInternalInsertPlan(tableHandle, columnHandles, viewAnalysis.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) RefreshMaterializedViewReference(com.facebook.presto.sql.planner.plan.TableWriterNode.RefreshMaterializedViewReference)

Aggregations

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