lvyanquan commented on code in PR #4484:
URL: https://github.com/apache/flink-cdc/pull/4484#discussion_r3717385937
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/functions/impl/ComparisonFunctions.java:
##########
@@ -61,27 +72,80 @@ public static boolean greaterThan(Object lhs, Object rhs) {
return universalCompares(lhs, rhs) > 0;
}
+ public static Boolean sqlGreaterThan(Object lhs, Object rhs) {
+ if (lhs == null || rhs == null) {
+ return null;
+ }
+ return universalCompares(lhs, rhs) > 0;
Review Comment:
The existing `universalCompares` should remain unchanged to preserve
`DEFAULT` behavior. However, the new `FLINK_SQL` path should use a SQL-specific
numeric comparator to avoid `double` precision loss, cross-type equality
failures such as `Long.equals(Integer)`, and scale-sensitive
`BigDecimal.equals`. This comparator should be shared by equality, ordering,
`BETWEEN`, and `IN`.
--
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]