mihaibudiu commented on code in PR #4131:
URL: https://github.com/apache/calcite/pull/4131#discussion_r1909683710
##########
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:
I have made the code clearer - but by mistake I amended the commit instead
of adding a new one.
--
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]