Search in sources :

Example 1 with Parameter

use of com.facebook.presto.sql.tree.Parameter in project presto by prestodb.

the class TestSetSessionTask method testSetSessionWithParameters.

@Test
public void testSetSessionWithParameters() {
    List<Expression> expressionList = new ArrayList<>();
    expressionList.add(new StringLiteral("ban"));
    expressionList.add(new Parameter(0));
    testSetSessionWithParameters("bar", new FunctionCall(QualifiedName.of("concat"), expressionList), "banana", ImmutableList.of(new StringLiteral("ana")));
}
Also used : StringLiteral(com.facebook.presto.sql.tree.StringLiteral) Expression(com.facebook.presto.sql.tree.Expression) ArrayList(java.util.ArrayList) Parameter(com.facebook.presto.sql.tree.Parameter) FunctionCall(com.facebook.presto.sql.tree.FunctionCall) Test(org.testng.annotations.Test)

Example 2 with Parameter

use of com.facebook.presto.sql.tree.Parameter in project presto by prestodb.

the class AstBuilder method visitParameter.

@Override
public Node visitParameter(SqlBaseParser.ParameterContext context) {
    Parameter parameter = new Parameter(getLocation(context), parameterPosition);
    parameterPosition++;
    return parameter;
}
Also used : Parameter(com.facebook.presto.sql.tree.Parameter)

Aggregations

Parameter (com.facebook.presto.sql.tree.Parameter)2 Expression (com.facebook.presto.sql.tree.Expression)1 FunctionCall (com.facebook.presto.sql.tree.FunctionCall)1 StringLiteral (com.facebook.presto.sql.tree.StringLiteral)1 ArrayList (java.util.ArrayList)1 Test (org.testng.annotations.Test)1