sbroeder commented on code in PR #5297: URL: https://github.com/apache/calcite/pull/5297#discussion_r4243917349
########## site/_docs/reference.md: ########## @@ -1828,6 +1828,20 @@ i: implicit cast / e: explicit cast / x: not allowed make `1 = true` and `0 = false` always evaluate to `TRUE`; if there is numeric type operand, find common type for both operands; if operands are `UUID` and `CHARACTER` or `BINARY`, promote to `UUID`. + By default, comparing `DECIMAL` with `REAL` or `DOUBLE` narrows to the + approximate type (`REAL` has 24-bit mantissa, about 7 decimal digits), + so distinct values can compare as equal. The same applies to `BETWEEN`, + `IN`, quantified comparisons, `NATURAL JOIN`, and `JOIN USING`, and to + the element types of `ARRAY`, `MAP`, and `ROW`. (`CASE`, `COALESCE`, + and set operations are not affected: they already use `DOUBLE` for this + combination.) To widen to `DOUBLE` instead, override + `TypeCoercion#commonTypeForBinaryComparison` in a `TypeCoercionImpl` Review Comment: Done. Added the rule and covered INTEGER and BIGINT -- 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]
