Skip to content

Conversation

@LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Dec 26, 2023

What changes were proposed in this pull request?

This pr aims to replace .reverse.find with .findLast in Spark code.

Why are the changes needed?

  1. The .findLast seems more concise.
  2. The .reverse involves a copy of the collection, while StringOps/ArrayOps.findLast wraps the input data into a ReverseIterator to avoid collection copying.

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 marked this pull request as draft December 26, 2023 06:28
@LuciferYang LuciferYang changed the title [SPARK-46509][CORE] Replace reverse.find with findLast [SPARK-46509][CORE] Replace .reverse.find with findLast Dec 26, 2023
@LuciferYang LuciferYang changed the title [SPARK-46509][CORE] Replace .reverse.find with findLast [SPARK-46509][CORE] Replace .reverse.find with .findLast Dec 26, 2023
@LuciferYang LuciferYang changed the title [SPARK-46509][CORE] Replace .reverse.find with .findLast [SPARK-46509][CORE][SS] Replace .reverse.find with .findLast Dec 26, 2023
@LuciferYang LuciferYang marked this pull request as ready for review December 27, 2023 02:53
@dongjoon-hyun
Copy link
Member

+1, LGTM. Merged to master. Thank you, @LuciferYang .

@LuciferYang
Copy link
Contributor Author

Thanks @dongjoon-hyun

@LuciferYang LuciferYang deleted the find-last branch May 1, 2025 13:40
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.

2 participants