sbroeder opened a new pull request, #5297:
URL: https://github.com/apache/calcite/pull/5297

   commonTypeForBinaryComparison() picked whichever operand was approximate as 
the common type for a comparison against DECIMAL, narrowing the DECIMAL side to 
that operand's precision.
   
   A 32-bit REAL/FLOAT holds only ~7 significant digits, so a DECIMAL literal 
or column with more digits than that can silently collide with a different 
value after narrowing.  For example, 59999943 and 59999945 both round to the 
same float.
   
   By widening the common type to DOUBLE whenever the exact-numeric operand is 
a DECIMAL, we don't lose precision.
   
   Updated ArrowAdapterTest's expected plan, which now casts a FLOAT column to 
DOUBLE when compared against a DECIMAL literal.
   
   ## Jira Link
   
   [CALCITE-7827](https://issues.apache.org/jira/browse/CALCITE-7827)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to