zhengruifeng opened a new pull request, #57745: URL: https://github.com/apache/spark/pull/57745
### What changes were proposed in this pull request? This PR passes `keepInvalid` into `StringIndexerModel.getIndexer`, computes it once during transformation, and uses one `OpenHashMap.get` lookup for non-null labels. ### Why are the changes needed? The previous UDF performed `contains` followed by map access for known labels, causing two lookups per value. This removes the redundant lookup while preserving invalid-label behavior. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Not run (not requested). Verified with `git diff --check`, ASCII scan, and changed-line length scan. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Codex (GPT-5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
