xuzifu666 commented on code in PR #5161:
URL: https://github.com/apache/calcite/pull/5161#discussion_r3728082061


##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -3744,4 +3762,312 @@ void addSarg(Sarg sarg, boolean negate, RelDataType 
type) {
       }
     }
   }
+
+  /** Flips a comparison operator. e.g., GREATER_THAN → LESS_THAN. */
+  private static SqlKind flipComparison(SqlKind kind) {

Review Comment:
   Good catch!SqlKind#reverse() does serve the same purpose. It maps the four 
ordering comparisons identically, and for EQUALS/NOT_EQUALS it returns the kind 
unchanged, which is exactly what we want since a = b ⇔ b = a and a <> b ⇔ b <> 
a. I've removed flipComparison and replaced its three call sites with 
kind.reverse(). Thanks!



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