LuciferYang opened a new pull request, #51961:
URL: https://github.com/apache/spark/pull/51961

   ### What changes were proposed in this pull request?
   This PR aims to use Java 9+ `Set.of` API instead of `ImmutableSet.of` API. 
   
   ### Why are the changes needed?
   
   Java's native API is **shorter and faster**.
   
   ```scala
   scala> spark.version
   val res0: String = 4.1.0-preview1
   
   scala> spark.time((1 until 100_000_000).foreach(_ => java.util.Set.of(1, 2, 
3, 4, 5, 6, 7, 8, 9, 10)))
   Time taken: 4287 ms
   
   scala> spark.time((1 until 100_000_000).foreach(_ => 
com.google.common.collect.ImmutableSet.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)))
   Time taken: 15024 ms
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   No behavior change.
   
   ### How was this patch tested?
   
   Pass the CIs.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


-- 
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]

Reply via email to