You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/10/02 19:31:55 UTC

[GitHub] [calcite] julianhyde commented on a change in pull request #1462: [CALCITE-3353]ProjectJoinTransposeRule caused AssertionError when creating a new Join

julianhyde commented on a change in pull request #1462: [CALCITE-3353]ProjectJoinTransposeRule caused AssertionError when creating a new Join
URL: https://github.com/apache/calcite/pull/1462#discussion_r330731643
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCorrelate.java
 ##########
 @@ -77,6 +78,13 @@ public static EnumerableCorrelate create(
   @Override public EnumerableCorrelate copy(RelTraitSet traitSet,
       RelNode left, RelNode right, CorrelationId correlationId,
       ImmutableBitSet requiredColumns, JoinRelType joinType) {
+    // Get new collations since the Correlate has new inputs and new condition.
+    ImmutableList<RelCollation> newCollations = ImmutableList.copyOf(
+            RelMdCollation.enumerableCorrelate(
+            getCluster().getMetadataQuery(), left, right, joinType));
+    if (!newCollations.isEmpty()) {
+      traitSet = traitSet.replace(newCollations);
 
 Review comment:
   Yes. Let's make ProjectJoinTransposeRule.INSTANCE just match LogicalJoin and LogicalProject. Add class arguments so that people can create other instances of the rule, if they wish.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services