Skip to content

[MINOR][SS] Use filterNot in HDFSBackedStateStoreProvider snapshot filtering - #57519

Closed
uros-b wants to merge 1 commit into
apache:masterfrom
uros-b:cleanup-hdfs-state-filternot
Closed

uros-b wants to merge 1 commit into
apache:masterfrom
uros-b:cleanup-hdfs-state-filternot

Conversation

@uros-b

@uros-b uros-b commented Jul 25, 2026

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Replaces filter(_.isSnapshot == false) with the equivalent, idiomatic filterNot(_.isSnapshot) in HDFSBackedStateStoreProvider.doSnapshot.

Why are the changes needed?

StoreFile.isSnapshot is a plain Boolean field, so comparing it to false is redundant. filterNot is the idiomatic form used throughout Spark and reads more clearly.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Behavior-preserving one-line change; existing state-store tests cover the path. No new tests needed.

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

Generated-by: Claude Code (Opus 4.8)

@uros-b uros-b left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Waiting for CI

@dongjoon-hyun dongjoon-hyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, LGTM.

BTW, if you want to backport this to branch-4.x for Spark 4.3.0, you had better get a new JIRA ID.

Otherwise, this is only for Apache Spark 5.0.0 (master).

@uros-b

uros-b commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

Thank you @dongjoon-hyun! Merging to master only

@uros-b uros-b closed this in fd31694 Jul 26, 2026
@uros-b

uros-b commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

Merge Summary:

Posted by merge_spark_pr.py

@cloud-fan

Copy link
Copy Markdown
Contributor

Hi @dongjoon-hyun , I'm good with holding a decent bar of creating JIRA tickets instead of using [MINOR], but this decision should not be related to merging to master only or not. We create master branch to delay breaking changes, not to delay minor changes.

This PR should be merged to 4.x. For creating JIRA ticket or not for this change, I don't have a strong opinion but if a committer raises a concern then we should always create one.

@uros-b can you create a 4.x backport?

@uros-b

uros-b commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

Thank you @cloud-fan, let me backport to 4.x as well

uros-b added a commit that referenced this pull request Aug 13, 2026
…ltering

### What changes were proposed in this pull request?
Replaces `filter(_.isSnapshot == false)` with the equivalent, idiomatic `filterNot(_.isSnapshot)` in `HDFSBackedStateStoreProvider.doSnapshot`.

### Why are the changes needed?
`StoreFile.isSnapshot` is a plain `Boolean` field, so comparing it to `false` is redundant. `filterNot` is the idiomatic form used throughout Spark and reads more clearly.

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

### How was this patch tested?
Behavior-preserving one-line change; existing state-store tests cover the path. No new tests needed.

### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)

Closes #57519 from uros-b/cleanup-hdfs-state-filternot.

Lead-authored-by: Uros Bojanic <[email protected]>
Co-authored-by: Uros Bojanic <[email protected]>
Signed-off-by: Uros Bojanic <[email protected]>
(cherry picked from commit fd31694)
Signed-off-by: Uros Bojanic <[email protected]>
@uros-b

uros-b commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Merge Summary:

Posted by merge_spark_pr.py

@uros-b

uros-b commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Backported to branch-4.x as well, according to #57519 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants