Search in sources :

Example 11 with FunctionCallBuilder

use of io.prestosql.sql.planner.FunctionCallBuilder in project hetu-core by openlookeng.

the class TestSetSessionTask method testSetSessionWithParameters.

@Test
public void testSetSessionWithParameters() {
    FunctionCall functionCall = new FunctionCallBuilder(metadata).setName(QualifiedName.of("concat")).addArgument(VARCHAR, new StringLiteral("ban")).addArgument(VARCHAR, new Parameter(0)).build();
    testSetSessionWithParameters("bar", functionCall, "banana", ImmutableList.of(new StringLiteral("ana")));
}
Also used : StringLiteral(io.prestosql.sql.tree.StringLiteral) Parameter(io.prestosql.sql.tree.Parameter) FunctionCall(io.prestosql.sql.tree.FunctionCall) FunctionCallBuilder(io.prestosql.sql.planner.FunctionCallBuilder) Test(org.testng.annotations.Test)

Example 12 with FunctionCallBuilder

use of io.prestosql.sql.planner.FunctionCallBuilder in project hetu-core by openlookeng.

the class TestSetSessionTask method testSetSession.

@Test
public void testSetSession() {
    testSetSession(new StringLiteral("baz"), "baz");
    testSetSession(new FunctionCallBuilder(metadata).setName(QualifiedName.of("concat")).addArgument(VARCHAR, new StringLiteral("ban")).addArgument(VARCHAR, new StringLiteral("ana")).build(), "banana");
}
Also used : StringLiteral(io.prestosql.sql.tree.StringLiteral) FunctionCallBuilder(io.prestosql.sql.planner.FunctionCallBuilder) Test(org.testng.annotations.Test)

Aggregations

FunctionCallBuilder (io.prestosql.sql.planner.FunctionCallBuilder)12 Symbol (io.prestosql.spi.plan.Symbol)10 Test (org.testng.annotations.Test)9 ImmutableMap (com.google.common.collect.ImmutableMap)7 ImmutableList (com.google.common.collect.ImmutableList)6 BaseRuleTest (io.prestosql.sql.planner.iterative.rule.test.BaseRuleTest)6 QualifiedName (io.prestosql.sql.tree.QualifiedName)6 RowExpression (io.prestosql.spi.relation.RowExpression)5 PlanBuilder (io.prestosql.sql.planner.iterative.rule.test.PlanBuilder)5 OriginalExpressionUtils (io.prestosql.sql.relational.OriginalExpressionUtils)5 LongLiteral (io.prestosql.sql.tree.LongLiteral)5 SymbolReference (io.prestosql.sql.tree.SymbolReference)5 TpchColumnHandle (io.prestosql.plugin.tpch.TpchColumnHandle)4 TpchTableHandle (io.prestosql.plugin.tpch.TpchTableHandle)4 TpchTransactionHandle (io.prestosql.plugin.tpch.TpchTransactionHandle)4 QualifiedObjectName (io.prestosql.spi.connector.QualifiedObjectName)4 TableHandle (io.prestosql.spi.metadata.TableHandle)4 AggregationNode (io.prestosql.spi.plan.AggregationNode)4 ProjectNode (io.prestosql.spi.plan.ProjectNode)4 Cast (io.prestosql.sql.tree.Cast)4