rubenada commented on a change in pull request #2168:
URL: https://github.com/apache/calcite/pull/2168#discussion_r494287567



##########
File path: core/src/test/java/org/apache/calcite/test/RelMetadataTest.java
##########
@@ -1618,20 +1619,23 @@ private void checkCollation(RelOptCluster cluster, 
RelOptTable empTable,
     final EnumerableMergeJoin join;
     join = EnumerableMergeJoin.create(project, deptSort,
         rexBuilder.makeLiteral(true), leftKeys, rightKeys, JoinRelType.INNER);
+    assertThat(join.getTraitSet().getConvention(), 
equalTo(EnumerableConvention.INSTANCE));

Review comment:
       Other similar operators (e.g. `EnumerableHashJoin`, 
`EnumerableNestedLoopJoin`, `EnumerableBatchNestedLoopJoin`) don't have this 
check in their constructors. In fact, it is not recommended to call these 
constructors directly (unless you know what you are doing) and they are not 
public, so I am ok with their current behavior of "trusting" the `RelTraitSet` 
parameter.
   On the contrary, `EnumerableMergeJoin#create` method is public (as the other 
`create` methods in the other join operators), so it is its responsibility to 
create a valid `traitSet` bafore calling `EnumerableMergeJoin`'s constructor.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to