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/04 16:53:28 UTC
[PR] [SPARK-59258] Support higher-order map functions [spark-connect-swift]
dongjoon-hyun opened a new pull request, #541:
URL: https://github.com/apache/spark-connect-swift/pull/541
### What changes were proposed in this pull request?
This PR adds the four higher-order map functions to `HigherOrderFunctions.swift`,
built on the lambda infrastructure added by SPARK-59254.
| Function | Closure |
| -------- | ------- |
| `map_filter(col, f)` | `(Column, Column) -> Column` (key, value) |
| `transform_keys(col, f)` | `(Column, Column) -> Column` (key, value) |
| `transform_values(col, f)` | `(Column, Column) -> Column` (key, value) |
| `map_zip_with(left, right, f)` | `(Column, Column, Column) -> Column` (key, value1, value2) |
`map_zip_with` is the first user of the three-argument `createLambda` overload,
which was added by SPARK-59254 but had no caller until now.
### Why are the changes needed?
For feature parity with Apache Spark. These four functions exist in both the
Scala and Python clients but had no Swift equivalent. They complete the set of
higher-order functions, whose array half landed in SPARK-59254.
### Does this PR introduce _any_ user-facing change?
Yes, this adds new public APIs. For example:
```swift
let df = try await spark.range(1)
let m = map_from_arrays(array(lit(1), lit(2)), array(lit(10), lit(20)))
try await df.select(map_filter(m) { _, v in v > 10 }.cast("string")).show()
// {2 -> 20}
try await df.select(transform_keys(m) { k, v in k + v }.cast("string")).show()
// {11 -> 10, 22 -> 20}
try await df.select(transform_values(m) { k, v in k + v }.cast("string")).show()
// {1 -> 11, 2 -> 22}
let m2 = map_from_arrays(array(lit(1), lit(2)), array(lit(100), lit(200)))
try await df.select(map_zip_with(m, m2) { _, v1, v2 in v1 + v2 }.cast("string")).show()
// {1 -> 110, 2 -> 220}
```
All four functions were introduced in Spark 3.1.0, so no version gate is needed.
### How was this patch tested?
Extended the existing `HigherOrderFunctionsTests` suite.
### 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-59258] Support higher-order map functions [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #541:
URL: https://github.com/apache/spark-connect-swift/pull/541#issuecomment-5543832605
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-59258] Support higher-order map functions [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #541:
URL: https://github.com/apache/spark-connect-swift/pull/541#issuecomment-5543993197
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
Re: [PR] [SPARK-59258] Support higher-order map functions [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #541: [SPARK-59258] Support higher-order map functions
URL: https://github.com/apache/spark-connect-swift/pull/541
--
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