-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-53941][SS] Support AQE in stateless streaming workloads #52642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HeartSaVioR
wants to merge
11
commits into
apache:master
Choose a base branch
from
HeartSaVioR:WIP-AQE-in-stateless-streaming-query
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[SPARK-53941][SS] Support AQE in stateless streaming workloads #52642
HeartSaVioR
wants to merge
11
commits into
apache:master
from
HeartSaVioR:WIP-AQE-in-stateless-streaming-query
+320
−106
Conversation
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
7b77520
to
bc9f672
Compare
I'll update the PR description once I confirmed CI passes. |
fbec355
to
50f24f1
Compare
cc. @viirya @anishshri-db Please take a look. Thanks! |
Interestingly I observed many cases where AQE was enabled in streaming workloads. Smart (or adventurous) customers changed the config in the user function of FEB sink to enforce turning on AQE, hence this had been tested in some different (unofficial) way as well. |
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.
What changes were proposed in this pull request?
This PR proposes to support AQE in stateless streaming workloads. We have been disabling it due to the incompatibility with stateful operator, but it's arguably too restricted given shuffles are still triggered in stateless streaming workloads and stream-static join can benefit with it.
Note that AQE performs re-optimization which replans via reapplying optimization and physical planning against a logical link (optimized plan) for stage. IncrementalExecution instance may not be available during AQE re-optimization (e.g. ForeachBatch sink), hence streaming specific physical planning rules aren't compatible with AQE re-optimization. These rules are reserved for initializing stateful operators, hence stateless workloads are still safe to apply full phase of AQE.
Worth mentioning that AQE is not enabled for 1) continuous mode (and upcoming real time mode) 2) stateful workloads.
Why are the changes needed?
There are still various cases where stateless operators trigger shuffle (e.g. stream-static join), and these operators have the same characteristic with batch query which AQE has been battle tested and proved its usefulness for a long time.
Does this PR introduce any user-facing change?
Yes, AQE will be enabled in stateless streaming workloads. Given that AQE is set to true by default, stateless streaming queries will take effect, regardless whether the query starts with new Spark version, or being upgraded from old Spark version. This PR also updates this to the migration guide.
How was this patch tested?
Existing tests will run with AQE enabled if the query is stateless.
Was this patch authored or co-authored using generative AI tooling?
No.