ILuffZhe commented on code in PR #4131:
URL: https://github.com/apache/calcite/pull/4131#discussion_r1909674968


##########
core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java:
##########
@@ -3443,12 +3444,32 @@ private RexNode convertUsing(SqlValidatorNamespace 
leftNamespace,
           throw new AssertionError("field " + name + " is not found in "
               + rowType + " with " + nameMatcher);
         }
+
+        fieldTypes.add(field.getType());
         operands.add(
             rexBuilder.makeInputRef(field.getType(),
                 offset + field.getIndex()));
         offset += rowType.getFieldList().size();
       }
-      list.add(rexBuilder.makeCall(SqlStdOperatorTable.EQUALS, operands));
+
+      RelDataType resultType =
+          validator().getTypeCoercion().commonTypeForBinaryComparison(
+              fieldTypes.get(0), fieldTypes.get(1));
+      if (resultType == null) {
+        throw new IllegalArgumentException("Cannot compute compatible row 
type: " + fieldTypes);

Review Comment:
   Thanks for the clarify, I think you are right about whether exception can be 
thrown here.



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