Skip to content

[MSE] Support sender-side sorting for sort exchanges #19395

Description

@xiangfu0

Problem

PinotLogicalSortExchange currently sorts only on the receiver. Operators such as WINDOW and MATCH_RECOGNIZE therefore require the receiver to buffer and sort the complete exchanged input instead of merging already sorted sender streams.

Proposed scope

  • Add sender-side sorting using the exchange collation, including direction and null ordering.
  • Merge sorted mailbox streams incrementally on the receiver with bounded memory.
  • Preserve cancellation, deadline, backpressure, and error propagation behavior.
  • Add distributed tests covering multiple senders, duplicate keys, nulls, and empty streams.

Context

Follow-up to #19311 and the existing receiver-side-only note in PinotWindowExchangeNodeInsertRule.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    multi-stageRelated to the multi-stage query enginequeryRelated to query processing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions