vlsi commented on a change in pull request #2168:
URL: https://github.com/apache/calcite/pull/2168#discussion_r494282536
##########
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:
Should this check be moved to `EnumerableMergeJoin` constructor?
##########
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:
See
https://github.com/apache/calcite/blob/978bb7ea44969351468d1b5e240e8f57af7e5770/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCalc.java#L77
and other assertions of that kind:
https://github.com/apache/calcite/search?q=%22getConvention%28%29+instanceof+EnumerableConvention%22
##########
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:
Great. Then the assertion in the test won't be needed
##########
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:
I think we do not need to duplicate logic though.
For instance, if the method receives `String`, then we don't need to add a
test that tries to pass `Integer` there.
The assertion in the constructor covers all the possible ways to create
`EnumerableMergeJoin`, so it is more-or-less enough from my point of view.
----------------------------------------------------------------
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]