Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

This PR skips creating the partition specs in ShufflePartitionsUtil for 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

@cloud-fan
Copy link
Contributor Author

cc @maryannxue @JkSelf @gatorsmile

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-31452][SQL] Do not create partition spec for 0-size partitions [SPARK-31452][SQL] Do not create partition spec for 0-size partitions in AQE Apr 15, 2020
@SparkQA
Copy link

SparkQA commented Apr 15, 2020

Test build #121330 has finished for PR 28226 at commit 5a3d1fe.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

// 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
Copy link
Member

@dongjoon-hyun dongjoon-hyun Apr 16, 2020

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.
Copy link
Member

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.

@dongjoon-hyun
Copy link
Member

Hi, @cloud-fan . The new logic looks good to me. I left only two minor comments.

@JkSelf
Copy link
Contributor

JkSelf commented Apr 17, 2020

LGTM

@SparkQA
Copy link

SparkQA commented Apr 20, 2020

Test build #121505 has finished for PR 28226 at commit 3eccb70.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a 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.

cloud-fan added a commit that referenced this pull request Aug 3, 2020
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants