Search in sources :

Example 1 with TimeLiteral

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

the class TestSqlParser method testLiterals.

@Test
public void testLiterals() {
    assertExpression("TIME 'abc'", new TimeLiteral("abc"));
    assertExpression("TIMESTAMP 'abc'", new TimestampLiteral("abc"));
    assertExpression("INTERVAL '33' day", new IntervalLiteral("33", Sign.POSITIVE, IntervalField.DAY, Optional.empty()));
    assertExpression("INTERVAL '33' day to second", new IntervalLiteral("33", Sign.POSITIVE, IntervalField.DAY, Optional.of(IntervalField.SECOND)));
    assertExpression("CHAR 'abc'", new CharLiteral("abc"));
}
Also used : IntervalLiteral(io.trino.sql.tree.IntervalLiteral) TimestampLiteral(io.trino.sql.tree.TimestampLiteral) CharLiteral(io.trino.sql.tree.CharLiteral) TimeLiteral(io.trino.sql.tree.TimeLiteral) Test(org.junit.jupiter.api.Test)

Aggregations

CharLiteral (io.trino.sql.tree.CharLiteral)1 IntervalLiteral (io.trino.sql.tree.IntervalLiteral)1 TimeLiteral (io.trino.sql.tree.TimeLiteral)1 TimestampLiteral (io.trino.sql.tree.TimestampLiteral)1 Test (org.junit.jupiter.api.Test)1