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 07:28:42 UTC
[PR] [SPARK-59245] Support HLL sketch and bitmap aggregate functions [spark-connect-swift]
dongjoon-hyun opened a new pull request, #538:
URL: https://github.com/apache/spark-connect-swift/pull/538
### What changes were proposed in this pull request?
This PR aims to support 7 HLL sketch and bitmap aggregate functions (12 declarations), which
completes the sketch function coverage of this client.
| Function | Since |
| --- | --- |
| `hll_sketch_agg`, `hll_union_agg` | 3.5.0 |
| `hll_sketch_estimate`, `hll_union` | 3.5.0 |
| `bitmap_construct_agg`, `bitmap_or_agg` | 3.5.0 |
| `bitmap_and_agg` | **4.1.0** |
The 5 aggregate functions go into `AggregateFunctions.swift`, following the `theta_sketch_agg`,
`kll_sketch_agg_*` and `tuple_sketch_agg_*` precedents. The 2 scalar functions live in a new
`HllSketchFunctions.swift`, mirroring `ThetaSketchFunctions.swift`.
Optional arguments follow the upstream implementations exactly and are expressed as overloads.
`lgConfigK` gets an `Int32` overload alongside the `Column` one, since the server requires the
`INT` type there and the existing `lit(_ value: Int)` produces a `BIGINT` literal that would be
rejected. `allowDifferentLgConfigK` is `Union[bool, Column]` in `hll_union_agg` and gets both a
`Bool` and a `Column` overload, while `hll_union` accepts a `Bool` only, matching
`def hll_union(c1: Column, c2: Column, allowDifferentLgConfigK: Boolean)` in the Scala API.
### Why are the changes needed?
To improve API coverage. These functions are available in PySpark and the Spark SQL Scala API,
but were missing from this Swift client. The scalar `bitmap_bit_position`,
`bitmap_bucket_number` and `bitmap_count` functions are already supported, and these three
aggregate functions complete that family.
### Does this PR introduce _any_ user-facing change?
No, this is a new addition to the API.
```swift
let df = try await spark.sql("SELECT * FROM VALUES (1), (2), (2), (3) AS T(v)")
try await df.select(hll_sketch_estimate(hll_sketch_agg(col("v")))).show()
```
```
+----------------------------------------------+
|hll_sketch_estimate(hll_sketch_agg(v, 12)) |
+----------------------------------------------+
|3 |
+----------------------------------------------+
```
```swift
try await df.select(bitmap_count(bitmap_construct_agg(bitmap_bit_position(col("v"))))).show()
```
```
+-------------------------------------------------------+
|bitmap_count(bitmap_construct_agg(bitmap_bit_position(v)))|
+-------------------------------------------------------+
|3 |
+-------------------------------------------------------+
```
### How was this patch tested?
Pass the CIs with a new test 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-59245] Support HLL sketch and bitmap aggregate functions [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #538: [SPARK-59245] Support HLL sketch and bitmap aggregate functions
URL: https://github.com/apache/spark-connect-swift/pull/538
--
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-59245] Support HLL sketch and bitmap aggregate functions [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #538:
URL: https://github.com/apache/spark-connect-swift/pull/538#issuecomment-5537369396
Oh, thank you, @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-59245] Support HLL sketch and bitmap aggregate functions [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #538:
URL: https://github.com/apache/spark-connect-swift/pull/538#issuecomment-5537375961
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