You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2026/09/03 17:00:21 UTC

[PR] [SPARK-59209] Support greatest, least, random and try arithmetic functions [spark-connect-swift]

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59209] Support `greatest`, `least`, `random` and `try_*` arithmetic functions [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #516:
URL: https://github.com/apache/spark-connect-swift/pull/516#issuecomment-5529216336

   Thank you always, @viirya .


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59209] Support `greatest`, `least`, `random` and `try_*` arithmetic functions [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #516: [SPARK-59209] Support `greatest`, `least`, `random` and `try_*` arithmetic functions
URL: https://github.com/apache/spark-connect-swift/pull/516


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59209] Support `greatest`, `least`, `random` and `try_*` arithmetic functions [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #516:
URL: https://github.com/apache/spark-connect-swift/pull/516#issuecomment-5529389888

   Merged to main


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org