[ 
https://issues.apache.org/jira/browse/CALCITE-2067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17894729#comment-17894729
 ] 

Oliver Lee commented on CALCITE-2067:
-------------------------------------

Was there any follow-up discussion about Julian's comment: "I don't feel 
comfortable allowing {{Double}} values in {{{}RexLiteral.valueMatchesType{}}}. 
A lot of code relies upon the value being a {{{}BigDecimal{}}}." ?

 

Looks like this broke deserializing Sarg arguments, precisely 
[rangeEndPointFromJson|https://github.com/apache/calcite/blob/2e99d5118efbba21c87e7da08b8359ce296e138d/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java#L940]
  which only creates it using BigDecimals. 

 

 

 

> RexLiteral cannot represent accurately floating point values, including NaN, 
> Infinity
> -------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2067
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2067
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.13.0
>            Reporter: Volodymyr Tkach
>            Assignee: Mihai Budiu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.38.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently we are working in Drill to allow support for Nan an Infinity values 
> . 
> When using such values with functions we see the NumberFormatException 
> exception. 
> Query example: _select sin(cast('NaN' as float))_
> RexBuilder#clean and other RexBuilder's methods use BigDecimal for handling 
> Double values, that's why we get NumberFormatException for nan,inf values.



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

Reply via email to