[
https://issues.apache.org/jira/browse/CALCITE-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17265428#comment-17265428
]
Jesus Camacho Rodriguez edited comment on CALCITE-4467 at 1/14/21, 11:07 PM:
-----------------------------------------------------------------------------
I don't advocate for changing Calcite's default semantics. However, different
engines seem to implement this differently. Thus, the main idea behind this
JIRA was to explore whether it would make sense to skip the simplification in
Calcite and leave the evaluation of such expressions to the specific engine
implementation. I also understand that even if we decided to do that, the
current PR should be extended to cover all cases in which current
simplifications would not be correct anymore in presence of 'NaN', which is not
trivial.
If we assume that 'NaN' is not a possible value in Calcite, then we may close
this JIRA as not an issue.
was (Author: jcamachorodriguez):
I don't advocate for changing Calcite's default semantics. However, different
engines seem to be implement this differently. Thus, the main idea behind this
JIRA was to explore whether it would make sense to skip the simplification in
Calcite and leave the evaluation of such expressions to the specific engine
implementation. I also understand that even if we decided to do that, the
current PR should be extended to cover all cases in which current
simplifications would not be correct anymore in presence of 'NaN', which is not
trivial.
If we assume that 'NaN' is not a possible value in Calcite, then we may close
this JIRA as not an issue.
> 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: Jesus Camacho Rodriguez
> Assignee: Jesus Camacho Rodriguez
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> 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.3.4#803005)