feat(shuffle): add row-based threshold option - #852
Merged
zhangxffff merged 1 commit intoAug 13, 2026
Conversation
Keep the existing partition and column thresholds, and add a configurable partition-column product threshold for adaptive row-based shuffle selection. Co-authored-by: TRAE CLI <noreply@bytedance.com>
guhaiyan0221
approved these changes
Aug 13, 2026
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.
What problem does this PR solve?
Adaptive shuffle currently selects the row-based implementation only when both fixed thresholds are met: at least 8,000 partitions and at least 5 columns. This cannot represent workloads whose combined partition-column scale is large while either dimension remains below its fixed threshold.
This PR adds an opt-in product threshold so row-based shuffle can also be selected when
numPartitions * numColumnsexceeds a configurable value, while preserving the existing default behavior.Issue Number: #853
Type of Change
Description
rowBasedShuffleThresholdto bothShuffleWriterOptionsandShuffleReaderOptions.numPartitions >= 8000 && numColumns >= 5.numPartitions * numColumns > rowBasedShuffleThreshold.int64_tfor the product calculation to avoid 32-bit overflow.SparkShuffleReader, andBoltColumnarBatchDeserializerFactory.std::numeric_limits<int64_t>::max(), disabling the new rule unless explicitly configured.The writer and reader must be configured with the same threshold to ensure they agree on the shuffle wire format.
Performance Impact
The default configuration preserves the existing shuffle selection behavior. The additional multiplication and comparison occur during writer or reader initialization rather than per row. Configuring the new threshold intentionally changes which shuffle implementation is selected.
Release Note
Checklist (For Author)
Breaking Changes