You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/03/15 23:52:00 UTC
[jira] [Updated] (CALCITE-7432) NumberFormatException when convert `NaN` literal to sql
[ https://issues.apache.org/jira/browse/CALCITE-7432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated CALCITE-7432:
------------------------------------
Labels: pull-request-available (was: )
> 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
> Assignee: krooswu
> Priority: Minor
> Labels: pull-request-available
>
> 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)