use of io.trino.sql.tree.RefreshMaterializedView in project trino by trinodb.
the class LogicalPlanner method planStatement.
public PlanNode planStatement(Analysis analysis, Statement statement) {
if ((statement instanceof CreateTableAsSelect && analysis.getCreate().orElseThrow().isCreateTableAsSelectNoOp()) || statement instanceof RefreshMaterializedView && analysis.isSkipMaterializedViewRefresh()) {
Symbol symbol = symbolAllocator.newSymbol("rows", BIGINT);
PlanNode source = new ValuesNode(idAllocator.getNextId(), ImmutableList.of(symbol), ImmutableList.of(new Row(ImmutableList.of(new GenericLiteral("BIGINT", "0")))));
return new OutputNode(idAllocator.getNextId(), source, ImmutableList.of("rows"), ImmutableList.of(symbol));
}
return createOutputPlan(planStatementWithoutOutput(analysis, statement), analysis);
}
use of io.trino.sql.tree.RefreshMaterializedView in project trino by trinodb.
the class TestSqlParser method testRefreshMaterializedView.
@Test
public void testRefreshMaterializedView() {
assertStatement("REFRESH MATERIALIZED VIEW test", new RefreshMaterializedView(Optional.empty(), new Table(QualifiedName.of("test"))));
assertStatement("REFRESH MATERIALIZED VIEW \"some name that contains space\"", new RefreshMaterializedView(Optional.empty(), new Table(QualifiedName.of("some name that contains space"))));
}
Aggregations