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


##########
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) {
+    switch (kind) {
+    case GREATER_THAN:
+      return SqlKind.LESS_THAN;
+    case GREATER_THAN_OR_EQUAL:
+      return SqlKind.LESS_THAN_OR_EQUAL;
+    case LESS_THAN:
+      return SqlKind.GREATER_THAN;
+    case LESS_THAN_OR_EQUAL:
+      return SqlKind.GREATER_THAN_OR_EQUAL;
+    case EQUALS:
+      return SqlKind.EQUALS;
+    case NOT_EQUALS:
+      return SqlKind.NOT_EQUALS;
+    default:
+      return kind;
+    }
+  }
+
+  /** Checks if a RexNode is a numeric literal (possibly wrapped in CAST). */
+  private static boolean isNumericLiteral(RexNode node) {

Review Comment:
   Could this be simplified by (re)using SqlTypeUtil#isNumeric ?



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