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


##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -703,6 +703,18 @@ private static boolean 
containsEquivalentComparison(List<RexNode> nodes,
     return false;
   }
 
+  /** Returns whether a comparison between {@code left} and {@code right}
+   * is well-formed, that is, its operands have the same type.
+   *
+   * <p>Comparisons whose operands have different types (e.g. a VARCHAR
+   * column compared with the BOOLEAN literal TRUE) never result from
+   * Calcite's own SQL translation, but clients that build Rex trees
+   * programmatically sometimes create them; such comparisons are left
+   * unsimplified. */
+  private static boolean isWellFormed(RexNode left, RexNode right) {

Review Comment:
   Thanks for your suggestion: I renamed the helper to 
isBooleanComparison(left, right) with your javadoc (the unverified provenance 
claim is gone; at simplifyComparison the call collapsed to a single condition, 
behavior unchanged).



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