Search in sources :

Example 56 with StringLiteral

use of io.trino.sql.tree.StringLiteral in project trino by trinodb.

the class TestSqlParser method testSessionIdentifiers.

@Test
public void testSessionIdentifiers() {
    assertStatement("SET SESSION \"foo-bar\".baz = 'x'", new SetSession(QualifiedName.of("foo-bar", "baz"), new StringLiteral("x")));
    assertStatementIsInvalid("SET SESSION foo-bar.name = 'value'").withMessage("line 1:16: mismatched input '-'. Expecting: '.', '='");
    assertStatement("RESET SESSION \"foo-bar\".baz", new ResetSession(QualifiedName.of("foo-bar", "baz")));
    assertStatementIsInvalid("RESET SESSION foo-bar.name").withMessage("line 1:18: mismatched input '-'. Expecting: '.', <EOF>");
}
Also used : SetSession(io.trino.sql.tree.SetSession) StringLiteral(io.trino.sql.tree.StringLiteral) ResetSession(io.trino.sql.tree.ResetSession) Test(org.junit.jupiter.api.Test)

Aggregations

StringLiteral (io.trino.sql.tree.StringLiteral)56 FunctionCall (io.trino.sql.tree.FunctionCall)25 LongLiteral (io.trino.sql.tree.LongLiteral)24 Test (org.junit.jupiter.api.Test)24 Test (org.testng.annotations.Test)19 Identifier (io.trino.sql.tree.Identifier)17 ComparisonExpression (io.trino.sql.tree.ComparisonExpression)13 Expression (io.trino.sql.tree.Expression)12 QueryUtil.quotedIdentifier (io.trino.sql.QueryUtil.quotedIdentifier)9 AllColumns (io.trino.sql.tree.AllColumns)9 BooleanLiteral (io.trino.sql.tree.BooleanLiteral)9 Property (io.trino.sql.tree.Property)9 Cast (io.trino.sql.tree.Cast)8 SymbolReference (io.trino.sql.tree.SymbolReference)8 ArithmeticBinaryExpression (io.trino.sql.tree.ArithmeticBinaryExpression)7 QualifiedName (io.trino.sql.tree.QualifiedName)7 QueryUtil.simpleQuery (io.trino.sql.QueryUtil.simpleQuery)6 CreateTable (io.trino.sql.tree.CreateTable)6 DoubleLiteral (io.trino.sql.tree.DoubleLiteral)6 GenericLiteral (io.trino.sql.tree.GenericLiteral)6