DeepSink He created CALCITE-7432:
------------------------------------

             Summary: NumberFormatException when convert `NaN` literal to sql
                 Key: CALCITE-7432
                 URL: https://issues.apache.org/jira/browse/CALCITE-7432
             Project: Calcite
          Issue Type: Bug
            Reporter: DeepSink He


SQL:
{code:java}
select cast('NaN' as DOUBLE){code}
LogicalPlan:
{code:java}
   LogicalValues(tuples=[[{ NaN }]]){code}
 

when conver the logical plan to SQL throws:
{code:java}
Exception in thread "main" java.lang.NumberFormatException: Character N is 
neither a decimal digit number, decimal point, nor "e" notation exponential 
mark.
    at java.base/java.math.BigDecimal.<init>(BigDecimal.java:629)
    at java.base/java.math.BigDecimal.<init>(BigDecimal.java:518)
    at java.base/java.math.BigDecimal.<init>(BigDecimal.java:924)
    at 
org.apache.calcite.sql.parser.SqlParserUtil.parseDecimal(SqlParserUtil.java:280)
    at 
org.apache.calcite.sql.SqlLiteral.createApproxNumeric(SqlLiteral.java:1009)
    at 
org.apache.calcite.rel.rel2sql.SqlImplementor.toSql(SqlImplementor.java:1598)
    at 
org.apache.calcite.rel.rel2sql.SqlImplementor.toSql(SqlImplementor.java:1550){code}
BigDecimal not accept `NaN` string as constructor arguments.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to