kgyrtkirk commented on a change in pull request #1432:
URL: https://github.com/apache/hive/pull/1432#discussion_r484385748



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveAggregateJoinTransposeRule.java
##########
@@ -145,8 +145,7 @@ public void onMatch(RelOptRuleCall call) {
         int fieldCount = joinInput.getRowType().getFieldCount();
         final ImmutableBitSet fieldSet =
             ImmutableBitSet.range(offset, offset + fieldCount);
-        final ImmutableBitSet belowAggregateKeyNotShifted =
-            belowAggregateColumns.intersect(fieldSet);

Review comment:
       right; the column which was causing the trouble was the preceeding 
join's joinkey.
   
   the issue was caused by
   * that between the previous / and current join there were no projects - so 
all the join keys of the previous join were present in the input
   * meanwhile the aggregate had references to `0,2,...` columns - which were 
unique; so the logic assumed that the `joinInput` could be used as is
   
   however..because column 1 was present in the input; but not in the output 
this have caused that the actual join was not in sync with the mapping being 
created
   
   I think the patch may make more sense than the above reasoning :)




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to