Indian-boult opened a new pull request, #20343:
URL: https://github.com/apache/pinot/pull/20343

   Fixes #20342
   
   The join branch of `PinotRelDistributionTraitRule.deriveDistribution` now 
keeps the left input's distribution only when the join type does not generate 
nulls on the left. A RIGHT or FULL join gets no distribution, so a GROUP BY, 
DISTINCT or window on a left column shuffles again. The physical optimizer gets 
the same rule in `WorkerExchangeAssignmentRule.computeCurrentNodeDistribution`, 
and `inheritDistDescFromInputsForJoin` no longer keeps the right input's 
distribution for LEFT and FULL joins.
   
   One cost. A later join on the key of the null side now shuffles where it 
used to reuse the distribution. That reuse never gave wrong rows, since a null 
key never matches in a join, so this only adds an exchange in that case.
   
   I added a case to `Joins.json` with four queries checked against H2: GROUP 
BY and DISTINCT on the left key of a RIGHT JOIN, GROUP BY on the right key of a 
LEFT JOIN, and a window partitioned by it. On master 5 of the 8 runs fail, for 
example `Expected Rows: [null, 5, 3000], [a, 2, 200], [b, 1, 200], [c, 1, 300] 
Actual Rows: [null, 3, 1800], [b, 1, 200], [null, 2, 1200], [c, 1, 300], [a, 2, 
200]`. With the change the full pinot-query-planner suite and the full 
`ResourceBasedQueriesTest` pass. Spotless, checkstyle and license checks pass 
on both modules.
   


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

To unsubscribe, e-mail: [email protected]

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