mihaibudiu commented on code in PR #5246:
URL: https://github.com/apache/calcite/pull/5246#discussion_r3997125363


##########
core/src/main/java/org/apache/calcite/rex/RexUtil.java:
##########
@@ -3005,13 +3007,52 @@ private static LinkedHashMap<RexNode, RexNode> 
commonFactors(List<RexNode> nodes
     private RexNode removeFactor(Map<RexNode, RexNode> factors, RexNode node) {
       List<RexNode> list = new ArrayList<>();
       for (RexNode operand : RelOptUtil.conjunctions(node)) {
-        if (!factors.containsKey(operand)) {
+        RexNode normalized = normalizeComparison(operand);
+        if (!factors.containsKey(normalized)) {
           list.add(operand);
         }
       }
       return and(list);
     }
 
+    /**
+     * Normalizes a comparison expression so that, when possible, an input ref

Review Comment:
   this only seems to work for comparisons of columns; this should be in the 
javadoc



-- 
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