ankitsultana opened a new issue, #15955:
URL: https://github.com/apache/pinot/issues/15955

   We should set `sortOnReceiver` to true in `PlanFragmentAndMailboxAssignment` 
if there's a collation in the `PhysicalExchange`.
   
   That should fix the issue. I had intentionally left this in the first 
iteration because I wanted to think through whether sortOnSender ever makes 
sense.
   
   I think we don't need to overthink here and simply always choose 
sortOnReceiver. AFAIR the existing query optimizer also does the same.
   
   Repro query with Colocated Join Quickstart (for each deviceOS, 101 should 
have been returned):
   
   ```
   SET useMultistageEngine = true;
   SET usePhysicalOptimizer = true;
   
   EXPLAIN PLAN FOR WITH tmp AS (
     SELECT deviceOS, totalTrips, daysSinceFirstTrip from userAttributes_OFFLINE
       WHERE daysSinceFirstTrip > 100
   )
   SELECT
     daysSinceFirstTrip,
     deviceOS
   FROM
     (
        SELECT
          deviceOS,
          daysSinceFirstTrip,
          ROW_NUMBER() OVER (
                PARTITION BY deviceOS
                ORDER BY daysSinceFirstTrip
          ) AS rnk
        FROM
          tmp
     ) tmp2
   WHERE
     rnk = 1
   ORDER BY deviceOS
   ```


-- 
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: commits-unsubscr...@pinot.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to