Skip to content

Conversation

@cloud-fan
Copy link
Contributor

@cloud-fan cloud-fan commented Jul 31, 2020

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

@cloud-fan
Copy link
Contributor Author

cc @manuzhang @viirya

@dongjoon-hyun
Copy link
Member

Could you resolve the conflict, @cloud-fan ?

@SparkQA
Copy link

SparkQA commented Jul 31, 2020

Test build #126892 has finished for PR 29321 at commit 4a0692a.

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

This PR updates the AQE framework to at least return one partition during coalescing.

This PR also updates `ShuffleExchangeExec.canChangeNumPartitions` to not coalesce for `SinglePartition`.

It's a bit risky to return 0 partitions, as sometimes it's different from empty data. For example, global aggregate will return one result row even if the input table is empty. If there is 0 partition, no task will be run and no result will be returned. More specifically, the global aggregate requires `AllTuples` and we can't coalesce to 0 partitions.

This is not a real bug for now. The global aggregate will be planned as partial and final physical agg nodes. The partial agg will return at least one row, so that the shuffle still have data. But it's better to fix this issue to avoid potential bugs in the future.

According to apache#28916, this change also fix some perf problems.

no

updated test.

Closes apache#29307 from cloud-fan/aqe.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
@manuzhang
Copy link
Member

@cloud-fan
The title seems not to be related to the partial backport.

@cloud-fan cloud-fan changed the title [SPARK-32083][SQL][3.0] AQE coalesce should at least return one partition [SPARK-32083][SQL][3.0] AQE should not coalesce partitions for SinglePartition Aug 3, 2020
@SparkQA
Copy link

SparkQA commented Aug 3, 2020

Test build #126948 has finished for PR 29321 at commit 6a06fba.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Aug 3, 2020

Test build #126967 has finished for PR 29321 at commit 6a06fba.

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

@cloud-fan
Copy link
Contributor Author

merged to 3.0

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]>
@cloud-fan cloud-fan closed this Aug 3, 2020
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.

5 participants