[25.10] Add missing handling for the 0 input partition count in computing partition count in GpuOptimizeWriteExchangeExec - #13804
Merged
Conversation
…tition count in GpuOptimizeWriteExchangeExec (NVIDIA#13780) Fixes NVIDIA#13779. `GpuOptimizeWriteExchangeExec` computes the `actualNumPartitions` based on the partition count of its input. The computed `actualNumPartitions` is used to dynamically optimize the partitioning. This logic is currently missing handling of the case when the input partition count is 0, which can cause the ArithmeticException error. This PR adds a proper handling of the case. - [ ] This PR has added documentation for new or modified features or behaviors. - [x] This PR has added new tests or modified existing tests to cover new code paths. (Please explain in the PR description how the new code paths are tested, such as names of the new/existing tests that cover them.) - [ ] Performance testing has been performed and its results are added in the PR description. Or, an issue has been filed with a link in the PR description. --------- Signed-off-by: Jihoon Son <ghoonson@gmail.com>
Contributor
Greptile Summary
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Spark as "Spark Execution"
participant Exchange as "GpuOptimizeWriteExchangeExec"
participant Child as "Child SparkPlan"
Spark->>Exchange: "executeColumnar()"
Exchange->>Child: "executeColumnar()"
Child-->>Exchange: "inputRDD"
Exchange->>Exchange: "Check childNumPartitions == 0"
alt childNumPartitions == 0
Exchange->>Exchange: "Set actualNumPartitions = 0"
Exchange->>Exchange: "Return Future.successful(null)"
Exchange->>Spark: "Return ShuffledBatchRDD"
else childNumPartitions > 0
Exchange->>Exchange: "Calculate actualNumPartitions"
Exchange->>Exchange: "Submit map stage"
Exchange->>Exchange: "Collect statistics"
Exchange->>Exchange: "Rebalance partitions"
Exchange->>Spark: "Return ShuffledBatchRDD with partition specs"
end
|
Contributor
There was a problem hiding this comment.
2 files reviewed, no comments
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
Collaborator
|
I usually do Can you manually add a line to the PR description to track lineage |
Collaborator
|
build |
Collaborator
Author
|
@gerashegalov updated the PR description. |
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.
Backport of #13780. Cherry picked from commit f02e77d.
Description
GpuOptimizeWriteExchangeExeccomputes theactualNumPartitionsbased on the partition count of its input. The computedactualNumPartitionsis used to dynamically optimize the partitioning. This logic is currently missing handling of the case when the input partition count is 0, which can cause the ArithmeticException error. This PR adds a proper handling of the case.Checklists
(Please explain in the PR description how the new code paths are tested, such as names of the new/existing tests that cover them.)