snuyanzin commented on code in PR #4972:
URL: https://github.com/apache/calcite/pull/4972#discussion_r3314524364


##########
core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java:
##########
@@ -1901,6 +1902,31 @@ public RelNode convertToSingleValueSubq(
     }
   }
 
+  /**
+   * Ensures that a comparison expression has matching operand types. If the
+   * operands have different type names, casts the right operand to match the
+   * left operand's type. This handles the case where type coercion is disabled
+   * and the IN-to-OR expansion produces comparisons with mismatched types
+   * (e.g., DATE = CHAR).
+   */
+  private RexNode ensureComparisonTypes(RexNode node) {

Review Comment:
   yes, same result, before the fix it didn't
   
   > Why not the leastRestrictive type?
   
   1. follow the approach that was before 
[CALCITE-6435](https://issues.apache.org/jira/browse/CALCITE-6435)
   2. in case of no leastRestrictive it will fail with NPE which is not user 
friednly
   in case of cast failure the error message will contain more helpful error 
description



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