Search in sources :

Example 1 with TimestampLiteral

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

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(com.facebook.presto.sql.tree.IntervalLiteral) TimestampLiteral(com.facebook.presto.sql.tree.TimestampLiteral) CharLiteral(com.facebook.presto.sql.tree.CharLiteral) TimeLiteral(com.facebook.presto.sql.tree.TimeLiteral) Test(org.testng.annotations.Test)

Aggregations

CharLiteral (com.facebook.presto.sql.tree.CharLiteral)1 IntervalLiteral (com.facebook.presto.sql.tree.IntervalLiteral)1 TimeLiteral (com.facebook.presto.sql.tree.TimeLiteral)1 TimestampLiteral (com.facebook.presto.sql.tree.TimestampLiteral)1 Test (org.testng.annotations.Test)1