rubenada commented on code in PR #4240:
URL: https://github.com/apache/calcite/pull/4240#discussion_r1991919288
##########
core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java:
##########
@@ -3458,22 +3458,20 @@ private RexNode convertUsing(SqlValidatorNamespace
leftNamespace,
validator().getTypeCoercion().commonTypeForBinaryComparison(
comparedTypes.get(0), comparedTypes.get(1));
if (resultType == null) {
- // This should never happen, since the program has been validated.
- throw new IllegalArgumentException("Cannot join on field `" + name
- + "` because the types are not comparable: " + comparedTypes);
- }
-
- List<RexNode> castedOperands = new ArrayList<>();
- for (int i = 0; i < operands.size(); i++) {
- RexNode operand = operands.get(i);
- RelDataType fieldType = comparedTypes.get(i);
- RexNode expr = operand;
- if (!fieldType.equals(resultType)) {
- expr = rexBuilder.makeCast(resultType, operand, true, false);
+ list.add(rexBuilder.makeCall(SqlStdOperatorTable.EQUALS, operands));
Review Comment:
Thanks for the quick feedback @mihaibudiu . I agree that the API is not very
clear in this regard.
I have added a comment as suggested.
--
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]