uros-b opened a new pull request, #58227: URL: https://github.com/apache/spark/pull/58227
### What changes were proposed in this pull request? Adds a unit test suite for `SparkCollectionUtils` (`common/utils`, `org.apache.spark.util`), which currently has no test coverage. The suite covers all four methods: - `toMapWithIndex` (including empty input, duplicate keys, and equivalence to `zipWithIndex.toMap`), - `isEmpty` / `isNotEmpty` (null, empty, and non-empty `java.util.Map`), - `createArray` (the per-primitive-type dispatch for Boolean/Byte/Short/Int/Long/Float/Double, plus reference types and `size == 0`). ### Why are the changes needed? `SparkCollectionUtils` is used in production (e.g. `StructType` field indexing via `toMapWithIndex`) but had no tests, leaving its `createArray` `ClassTag`-based dispatch in particular unguarded against regressions. ### Does this PR introduce _any_ user-facing change? No. Test-only. ### How was this patch tested? This PR is tests. The suite extends `AnyFunSuite`, the base used by the sibling utility suites in `common/utils` (e.g. `SparkStringUtilsSuite`). ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8) -- 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]
