-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-31452][SQL] Do not create partition spec for 0-size partitions in AQE #28226
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
Conversation
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewedJoin.scala
Show resolved
Hide resolved
|
Test build #121330 has finished for PR 28226 at commit
|
| // and the partitions length is 2 * numMappers = 4 | ||
| assert(localShuffleRDD1.getPartitions.length == 4) | ||
| // math.max(1, advisoryParallelism / numMappers): math.max(1, 3/2) = 1 | ||
| // and the partitions length is 2 * numMappers = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 * numMappers = 2 -> 1 * numMappers = 2?
| // Partition 4: only left side is skewed, and divide into 2 splits, so | ||
| // 2 sub-partitions. | ||
| // So total (8 + 1 + 3) partitions. | ||
| // So total (8 + 0 + 3) partitions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original statement was wrong: 8 + 1 + 3 -> 8 + 1 + 2.
So, the new statement should be 8 + 0 + 2 instead of 8 + 0 + 3.
|
Hi, @cloud-fan . The new logic looks good to me. I left only two minor comments. |
|
LGTM |
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewedJoin.scala
Show resolved
Hide resolved
|
Test build #121505 has finished for PR 28226 at commit
|
HyukjinKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM. Thank you, @cloud-fan and all.
Merged to master.
…Partition This is a partial backport of #29307 Most of the changes are not needed because #28226 is in master only. This PR only backports the safeguard in `ShuffleExchangeExec.canChangeNumPartitions` Closes #29321 from cloud-fan/aqe. Authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
This PR skips creating the partition specs in
ShufflePartitionsUtilfor 0-size partitions, which avoids launching unnecessary tasks that do nothing.Why are the changes needed?
launching tasks that do nothing is a waste.
Does this PR introduce any user-facing change?
no
How was this patch tested?
updated tests