Search in sources :

Example 26 with Row

use of io.trino.sql.tree.Row 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);
}
Also used : ValuesNode(io.trino.sql.planner.plan.ValuesNode) OutputNode(io.trino.sql.planner.plan.OutputNode) PlanNode(io.trino.sql.planner.plan.PlanNode) RefreshMaterializedView(io.trino.sql.tree.RefreshMaterializedView) CreateTableAsSelect(io.trino.sql.tree.CreateTableAsSelect) Row(io.trino.sql.tree.Row) GenericLiteral(io.trino.sql.tree.GenericLiteral)

Aggregations

Row (io.trino.sql.tree.Row)26 ImmutableList (com.google.common.collect.ImmutableList)15 Cast (io.trino.sql.tree.Cast)15 TypeSignatureTranslator.toSqlType (io.trino.sql.analyzer.TypeSignatureTranslator.toSqlType)14 ValuesNode (io.trino.sql.planner.plan.ValuesNode)13 Symbol (io.trino.sql.planner.Symbol)12 Expression (io.trino.sql.tree.Expression)11 FunctionCall (io.trino.sql.tree.FunctionCall)11 LongLiteral (io.trino.sql.tree.LongLiteral)11 Assignments (io.trino.sql.planner.plan.Assignments)10 NullLiteral (io.trino.sql.tree.NullLiteral)10 QualifiedName (io.trino.sql.tree.QualifiedName)10 StringLiteral (io.trino.sql.tree.StringLiteral)10 Test (org.testng.annotations.Test)10 RowType (io.trino.spi.type.RowType)9 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)8 BIGINT (io.trino.spi.type.BigintType.BIGINT)8 VARCHAR (io.trino.spi.type.VarcharType.VARCHAR)8 Type (io.trino.spi.type.Type)7 TypeSignatureProvider.fromTypes (io.trino.sql.analyzer.TypeSignatureProvider.fromTypes)7