zhengruifeng opened a new pull request, #57838: URL: https://github.com/apache/spark/pull/57838
### What changes were proposed in this pull request? This PR changes `StringIndexerModel` label lookup maps from `OpenHashMap[String, Double]` to `OpenHashMap[String, Int]`. The indexer UDF returns integer indexes, and the output column is cast to `DoubleType` at the end of the transformation. ### Why are the changes needed? String index values are inherently integral. Storing them as `Int` instead of `Double` reduces the memory footprint of the lookup maps captured by `StringIndexerModel` transformations while preserving the public double-valued output. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? The existing `StringIndexerSuite` covers normal, unseen, skipped, kept, null, numeric, and multi-column inputs as well as the `DoubleType` output contract. It passed all 28 tests: `build/sbt -java-home /usr/lib/jvm/java-17-openjdk-amd64 'mllib/testOnly org.apache.spark.ml.feature.StringIndexerSuite'` ### 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]
