Skip to content

Conversation

@karuppayya
Copy link
Contributor

What changes were proposed in this pull request?

Currently, shuffle cleanup only works for adaptive execution plans. Non-adaptive execution plans are not cleaned up. Thing change cleans it.

Why are the changes needed?

  • To cleanup shuffle files of non-adaptive query executions
  • Consistency in behavior between adaptive and non-adaptive shuffle cleanup based on the cleanup mode

Does this PR introduce any user-facing change?

No

How was this patch tested?

Modified existing unit tests to cover this case

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Jul 9, 2025
@dongjoon-hyun
Copy link
Member

cc @peter-toth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just realized that the test has a jira number. Should i create a new test with the jira id used for this change? @dongjoon-hyun please advise

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO you can extend the existing tests when the new functionality can be easily covered by those. But why didn't you adjust all SPARK-47764: ... tests?

Copy link
Contributor Author

@karuppayya karuppayya Jul 11, 2025

Choose a reason for hiding this comment

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

@peter-toth I modified only SPARK-47764: Cleanup shuffle dependencies - RemoveShuffleFiles mode, since my change was specific to org.apache.spark.sql.execution.RemoveShuffleFiles. I can add negatibve assertions to other and make them consistent . Let me know

Copy link
Contributor

@peter-toth peter-toth Jul 12, 2025

Choose a reason for hiding this comment

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

No, your PR affects other ShuffleCleanupModes too so the other 2 should work with both AQE enabled and disabled as well. All you need to do is to wrap those tests into an AQE on/off loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added blocks to other tests.
@peter-toth @dongjoon-hyun Can you take look please

Copy link
Member

Choose a reason for hiding this comment

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

I pinged the original author and committer, @karuppayya .

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.

This seems to be introduced at Apache Spark 4.0.0 by

cc @bozhang2820 and @cloud-fan from #45930

@karuppayya
Copy link
Contributor Author

@cloud-fan can you take a look if you have cycles

@cloud-fan
Copy link
Contributor

thanks, merging to master/4.0!

@cloud-fan cloud-fan closed this in 337a67f Aug 15, 2025
cloud-fan pushed a commit that referenced this pull request Aug 15, 2025
…on-adaptive execution

### What changes were proposed in this pull request?
Currently, shuffle cleanup only works for adaptive execution plans. Non-adaptive execution plans are not cleaned up. Thing change cleans it.

### Why are the changes needed?
- To cleanup shuffle files of non-adaptive query executions
- Consistency in behavior between adaptive and non-adaptive shuffle cleanup based on the cleanup mode

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Modified existing unit tests to cover this case

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #51432 from karuppayya/SPARK-52741.

Lead-authored-by: Karuppayya Rajendran <[email protected]>
Co-authored-by: Karuppayya Rajendran <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 337a67f)
Signed-off-by: Wenchen Fan <[email protected]>
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 14, 2025
…on-adaptive execution

### What changes were proposed in this pull request?
Currently, shuffle cleanup only works for adaptive execution plans. Non-adaptive execution plans are not cleaned up. Thing change cleans it.

### Why are the changes needed?
- To cleanup shuffle files of non-adaptive query executions
- Consistency in behavior between adaptive and non-adaptive shuffle cleanup based on the cleanup mode

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Modified existing unit tests to cover this case

### Was this patch authored or co-authored using generative AI tooling?
No

Closes apache#51432 from karuppayya/SPARK-52741.

Lead-authored-by: Karuppayya Rajendran <[email protected]>
Co-authored-by: Karuppayya Rajendran <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit af9910d)
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.

4 participants