[improvement](agg) Add passthrough local exchange before streaming ag…#65791
Closed
zclllyybb wants to merge 1 commit into
Closed
[improvement](agg) Add passthrough local exchange before streaming ag…#65791zclllyybb wants to merge 1 commit into
zclllyybb wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
…gregation ### What problem does this PR solve? Issue Number: None Related PR: apache#65579 Problem Summary: opt_perf_4.1 exposes enable_local_exchange_before_agg, but its default non-final streaming-aggregation path requests HASH_SHUFFLE whenever grouping keys are present. A streaming aggregation needs a pipeline boundary before aggregation without repartitioning rows, so Repeat-to-streaming-aggregation plans do not receive the intended passthrough local exchange. ### Release note Non-final streaming aggregation requests a passthrough local exchange by default when enable_local_exchange_before_agg is enabled. The setting false retains the existing base distribution behavior. ### Check List (For Author) - Test: BE and FE unit tests; isolated-cluster profile validation - Behavior changed: Yes, streaming aggregation uses passthrough rather than hash local exchange for this default-enabled setting. - Does this need documentation: No
zclllyybb
force-pushed
the
codex/streaming-agg-passthrough-opt-perf-4.1
branch
from
July 19, 2026 09:37
a8a90db to
8508fcf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…gregation
Problem: non-final streaming aggregation can consume rows directly from its upstream pipeline, even when separating the pipelines with a local passthrough exchange is required to match the intended Repeat-to-streaming-aggregation execution shape. opt_perf_4.1 already carries the thrift field but does not expose or consume it end to end.
Solution: expose enable_local_exchange_before_agg as a default-enabled session variable and propagate it to TQueryOptions. StreamingAggOperatorX requests PASSTHROUGH only for non-final streaming aggregation. The existing hash-join passthrough priority and explicit shuffled_agg_ids HASH_SHUFFLE override remain intact; disabling the variable, or receiving an unset field from an older FE, retains the original distribution behavior.
Validation: ./build.sh --fe; ./build.sh --be -j 48; ./run-fe-ut.sh --run org.apache.doris.qe.VariableMgrTest; ./run-be-ut.sh --run --filter=StreamingAggOperatorTest.require_passthrough_local_exchange_before_non_finalize_agg -j 90. On an isolated FE/BE, an uncached GROUPING SETS query with agg_phase=2 produced REPEAT -> LOCAL_EXCHANGE(PASSTHROUGH) -> STREAMING_AGGREGATION by default; setting the variable false removed that local exchange while retaining the streaming aggregation and result rows.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)