wenhuitang 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_r327986099
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinTransposeRule.java
 ##########
 @@ -142,13 +144,9 @@ public void onMatch(RelOptRuleCall call) {
 
     // create a new join with the projected children
     Join newJoinRel =
-        join.copy(
 
 Review comment:
   > Can you explain more, although the new join has new inputs, their type 
doesn't change, right ? So what do you mean by the offset ?
   
   For example: 
   EnumerableProject(age=[$3])
     EnumerableMergeJoin(condition=[=($1, $2)], joinType=[inner])
       EnumerableValues(tuples=[[{ '1', 'anna' }, { '2', 'bob' }, { '3', 'tom' 
}]])
       EnumerableValues(tuples=[[{ 'anna', '14' }, { 'bob', '17' }, { 'tom', 
'22' }]])
   before Project is pushed down, the collations of MergeJoin is [1, 2] and the 
leftkey of the JoinInfo is [1], 
   after Project is pushed down, the left child of MergeJoin becomes 
LogicalProject#68 whose output rowtype is RecordType(CHAR(4) name), so the 
leftkey becomes [0] (The index of field was changed). So IMO, the collations of 
new Join should be updated due to changes of the inputs.

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


With regards,
Apache Git Services

Reply via email to