[ 
https://issues.apache.org/jira/browse/CALCITE-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Steve Carlin reopened CALCITE-4467:
-----------------------------------

Want to reopen this issue for a small discussion.

Impala already has its own custom compiler and I'm trying to switch things over 
to use Calcite.  There is a huge regression testing framework in place for 
Impala, so any change in results is not desirable and not something I would 
wish to report to the end user.  

Obviously, this is a custom thing not supported by Calcite.  I'm hoping the 
Calcite community can help me workaround my problem by supporting the least 
painful solution for me while still keeping the semantics of Calcite.

If i were able to have my own custom RexSimplify, it would solve my issue.  I 
am currently testing with a version that turns off RexSimplify for the 
RelBuilder (thank you for that!) and all my regression tests passed in 1.40.

It's 1.41 that has caused me a problem, specifically CALCITE-7289, which I 
filed because of the fix for CALCITE-7070.  The subquery to correlate rule 
explciitly requires RexSimplify to be used. 

So here's my proposal: We already allow the capability to turn off RexSimplify 
for the rule.  Would we approve of a feature to allow a customizable 
RexSimplify to be used instead of RexSimplify?  I realize this is poking a hole 
in Calcite, but this hole would be extremely beneficial to my project.  Either 
that or I have to re-implement my own RelBuilder with a lot of copied code, and 
I would prefer to avoid that.

> Incorrect simplification for 'NaN' value
> ----------------------------------------
>
>                 Key: CALCITE-4467
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4467
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Jesús Camacho Rodríguez
>            Assignee: Jesús Camacho Rodríguez
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.27.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {{RexSimplify}} simplifies {{x = x}} to {{null or x is not null}} (similarly 
> <= and >=), and {{x != x}} to {{null and x is null}} (similarly < and >).
> https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/rex/RexSimplify.java#L363
> This may not be applicable in some cases. For instance, if the type of x is 
> floating-point, x could be 'NaN'. While some RDBMS consider 'NaN' = 'NaN' 
> (e.g., Postgres), some others consider 'NaN' != 'NaN' following the IEEE 754 
> standard. For the latest, the rewriting above will result in incorrect 
> results.
> I think we should simply ignore this simplification for floating-point type.



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

Reply via email to