Search in sources :

Example 11 with DoubleLiteral

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

the class TestSqlParser method testDouble.

@Test
public void testDouble() {
    assertExpression("123E7", new DoubleLiteral("123E7"));
    assertExpression("123.E7", new DoubleLiteral("123E7"));
    assertExpression("123.0E7", new DoubleLiteral("123E7"));
    assertExpression("123E+7", new DoubleLiteral("123E7"));
    assertExpression("123E-7", new DoubleLiteral("123E-7"));
    assertExpression("123.456E7", new DoubleLiteral("123.456E7"));
    assertExpression("123.456E+7", new DoubleLiteral("123.456E7"));
    assertExpression("123.456E-7", new DoubleLiteral("123.456E-7"));
    assertExpression(".4E42", new DoubleLiteral(".4E42"));
    assertExpression(".4E+42", new DoubleLiteral(".4E42"));
    assertExpression(".4E-42", new DoubleLiteral(".4E-42"));
}
Also used : DoubleLiteral(com.facebook.presto.sql.tree.DoubleLiteral) Test(org.testng.annotations.Test)

Aggregations

DoubleLiteral (com.facebook.presto.sql.tree.DoubleLiteral)11 StringLiteral (com.facebook.presto.sql.tree.StringLiteral)8 Test (org.testng.annotations.Test)8 LongLiteral (com.facebook.presto.sql.tree.LongLiteral)5 VariableReferenceExpression (com.facebook.presto.spi.relation.VariableReferenceExpression)4 ComparisonExpression (com.facebook.presto.sql.tree.ComparisonExpression)4 GenericLiteral (com.facebook.presto.sql.tree.GenericLiteral)4 SymbolReference (com.facebook.presto.sql.tree.SymbolReference)4 BooleanLiteral (com.facebook.presto.sql.tree.BooleanLiteral)3 Expression (com.facebook.presto.sql.tree.Expression)3 NullLiteral (com.facebook.presto.sql.tree.NullLiteral)3 Slice (io.airlift.slice.Slice)3 ArithmeticUnaryExpression (com.facebook.presto.sql.tree.ArithmeticUnaryExpression)2 Cast (com.facebook.presto.sql.tree.Cast)2 DecimalLiteral (com.facebook.presto.sql.tree.DecimalLiteral)2 FunctionCall (com.facebook.presto.sql.tree.FunctionCall)2 Session (com.facebook.presto.Session)1 Block (com.facebook.presto.common.block.Block)1 CharType (com.facebook.presto.common.type.CharType)1 DecimalType (com.facebook.presto.common.type.DecimalType)1