Skip to content

[Backport] MSQ: Fix composing channels losing partitionless frames.#18267

Merged
capistrant merged 1 commit intoapache:34.0.0from
capistrant:backport-18220-to-34.0.0
Jul 16, 2025
Merged

[Backport] MSQ: Fix composing channels losing partitionless frames.#18267
capistrant merged 1 commit intoapache:34.0.0from
capistrant:backport-18220-to-34.0.0

Conversation

@capistrant
Copy link
Contributor

Backport of #18220 to 34.0.0.

* MSQ: Fix composing channels losing partitionless frames.

The main change is that single-partition ComposingWritableFrameChannels (i.e.
those created by `ChannelOutputFactory#openChannel`) now associate all incoming
frames with that partition. Previously, frames might have come in with
partition set to `NO_PARTITION`, which would cause them to get "lost" by
the composing channel.

Fixes a bug introduced in apache#18144 when composed intermediate stage-internal
channels started being used for the output of hash partitioning. Prior to
apache#18144, they were only used for internal channels of the SuperSorter. This
bug could cause frames to go missing during sortMerge joins.

This patch also adds an embedded test for various durable storage scenarios,
including sortMerge join tests that would have caught the original bug.

Finally, this patch adjusts the way that Calcites escapes string literals,
to use the actual characters more often when possible. This helps format
the test SQLs generated by the embedded test more nicely.

* dependency analyze.

---------

Co-authored-by: Karan Kumar <karankumar1100@gmail.com>
@capistrant capistrant added this to the 34.0.0 milestone Jul 16, 2025
@capistrant capistrant merged commit b3f6a23 into apache:34.0.0 Jul 16, 2025
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants