Skip to content

[SPARK-48366][CORE][SQL][CONNECT] Simplify code statements related to .filter#46676

Closed
LuciferYang wants to merge 5 commits intoapache:masterfrom
LuciferYang:filter-and-size
Closed

[SPARK-48366][CORE][SQL][CONNECT] Simplify code statements related to .filter#46676
LuciferYang wants to merge 5 commits intoapache:masterfrom
LuciferYang:filter-and-size

Conversation

@LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented May 21, 2024

What changes were proposed in this pull request?

This pr simplifies some code statements related to filter as follows:

  1. .find(p).isDefined or .filter(p).nonEmpty to exists(p)
  2. collection.find(s => s == someValue).isEmpty to !collection.contains(someValue)
  3. filter(p).headOption to .find(p)
  4. .filter(!p).isEmpty to .forall(p)
  5. .filter(p).length to .count(p)
  6. .filter(p).size > 0 to .exists(p)

Why are the changes needed?

Simplify code statements related to filter

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass GitHub Actions

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

No

@LuciferYang LuciferYang changed the title [SPARK-48366][CORE][SQL][CONNECT] Simplify code statements related to filter [SPARK-48366][CORE][SQL][CONNECT] Simplify code statements related to .filter Jun 4, 2024
@LuciferYang LuciferYang closed this Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant