gortiz commented on PR #19121: URL: https://github.com/apache/pinot/pull/19121#issuecomment-7191035810
Two more things on the top commit. Today each server decides on its own whether to push the sort, from the time boundary, the logical-table map and the size of its table-segments map. The broker already has all of that when it assigns workers. I'd move the decision there and write it into the plan as an explicit property of the sender `SortNode` (something like `executeInLeaf`), serialized and shown in EXPLAIN. The server then follows the flag and infers nothing from the plan shape. That gives one decision per stage by construction, and the planner tests can check it. It also removes the dropped-stats problem during rolling upgrades: the broker emits the merge receive only in a homogeneous cluster, so no old server ever sees the flag. A nit on the offset check in `canPushUnboundedSort`. `PinotWindowExchangeNodeInsertRule` creates the sender sort with `LogicalSort.create(input, orderKeys, null, null)`, so it never has an offset. The `node.getOffset() > 0` condition is only defensive, and the overflow explanation in the comment describes a case that cannot happen. If the merge exchange ever covers `ORDER BY ... LIMIT L OFFSET O`, the sender would sort with fetch `L+O` and no offset, and the final stage would apply the offset, so there is no overflow there either. I'd say that in the comment instead. -- 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]
