Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
Description
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.
Attachments
Issue Links
- links to