wirybeaver commented on PR #16551:
URL: https://github.com/apache/pinot/pull/16551#issuecomment-3169562360

   > I was wondering which phase generate the PhysicalSort(fetch=[10000]) 
without the collation before this PR. IIUC, the Calcite will generate the 
LogicalWindow Node with collocation and doesn't create a LogicalSort Node along 
the way. If so, it means the pinot has glitches when translate from 
LogicalWindow to Physical Window by wrongly inserting the PhysicalSort Node 
without collation.
   > 
   > Moreover, what's the behavior of the general MSE plan? Shall we apply the 
same patch for non lite mode?
   
   Ankit provides the answers in slack. I pasted the explanation for future 
reference:
   
   >
   The default MSE generates a SortExchange under the LogicalWindow 
WindowExchangeNodeInsertRule if a collation is applicable.
   Physical optimizer uses TraitAssignment and adds a trait under the Window 
for the collation. 
[See](https://github.com/apache/pinot/blob/584119fce06d47387e8b68a9eceb8493eebe7b02/pinot-query-planner/src/main/java/org/apache/pinot/calcite/rel/traits/TraitAssignment.java#L192)
 
   For Lite Mode, we add a sort in the leaf stage. Currently the sort node was 
blindly added with a row limit. But, it could be that the Exchange just above 
leaf stage had a collation. That would happen when the node above Exchange had 
pushed down a Collation trait. So this bug was kinda specific to lite mode


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