[SPARK-43586][SQL] Use the smaller value of Range.numElements and Range.numSlices as numSlices of RangeExec#41230
Closed
LuciferYang wants to merge 3 commits intoapache:masterfrom
Closed
[SPARK-43586][SQL] Use the smaller value of Range.numElements and Range.numSlices as numSlices of RangeExec#41230LuciferYang wants to merge 3 commits intoapache:masterfrom
Range.numElements and Range.numSlices as numSlices of RangeExec#41230LuciferYang wants to merge 3 commits intoapache:masterfrom
Conversation
Member
Contributor
|
I feel it's better to always respect the user-specified num slice parameter. If the num slice is not specified, I agree that we can make it not larger than the num elements. |
Contributor
Author
This may require adding a status to record whether it is a user-specified slice or use default? Sounds like it will increase the complexity of the code. I don't think it's worth because this just a minor case, maybe keep it as it is is better |
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 changes were proposed in this pull request?
This pr change
RangeExec#numSlicesto use smaller value inRange.numElementsandRange.numSlicesto avoid scheduling unnecessary tasks.Why are the changes needed?
Avoid scheduling unnecessary tasks when
Range.numSlices>Range.numElements.Does this PR introduce any user-facing change?
Yes, when
Range.numSlices>Range.numElementsis, for the result ofqueryExecution.debug, thesplitsvalue in the printed Physical Plan will change.How was this patch tested?
start a spark-shell with
--master "local[100]", then runBefore
After