dongjoon-hyun opened a new pull request, #516: URL: https://github.com/apache/spark-connect-swift/pull/516
### What changes were proposed in this pull request? This PR aims to support the following 10 functions in `MathFunctions`. - Comparison: `greatest`, `least` - Random: `rand`, `randn`, `uniform` - Try arithmetic: `try_add`, `try_subtract`, `try_multiply`, `try_divide`, `try_mod` `greatest` and `least` take at least two `Column`s, which is expressed as two required parameters followed by a variadic one, and `rand`, `randn` and `uniform` provide an additional overload taking a random seed. ### Why are the changes needed? To provide the same set of math functions with Apache Spark and PySpark. - `greatest`, `least`, `rand` and `randn` exist since Apache Spark 1.4.0/1.5.0. - `try_add`, `try_subtract`, `try_multiply` and `try_divide` exist since Apache Spark 3.5.0. - `try_mod` and `uniform` exist since Apache Spark 4.0.0. ### Does this PR introduce _any_ user-facing change? No, this PR adds new functions only. ```swift let df = try await spark.range(1) try await df.select(greatest(lit(1), lit(2), lit(3)), least(lit(1), lit(2))).show() try await df.select(try_divide(lit(1), lit(0)), try_add(lit(Int64.max), lit(1))).show() try await df.select(rand(42), randn(42), uniform(lit(5), lit(105), lit(3))).show() ``` ### How was this patch tested? Pass the CIs with the newly added test cases. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 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]
