Ted-Jiang opened a new pull request #1841:
URL: https://github.com/apache/arrow-datafusion/pull/1841
# Which issue does this PR close?
Closes #1823.
# Rationale for this change
test result:
```
1million_1million.parquet
+----------------------------+
| COUNT(DISTINCT test.value) |
+----------------------------+
| 631504 |
+----------------------------+
1 row in set. Query took 1.225 seconds.
+---------------------------------+
| BITMAPCOUNTDISTINCT(test.value) |
+---------------------------------+
| 631504 |
+---------------------------------+·
1 row in set. Query took 0.175 seconds(roaring-rs).
+---------------------------------+
| BITMAPCOUNTDISTINCT(test.value) |
+---------------------------------+
| 631504 |
+---------------------------------+
1 row in set. Query took 0.052 seconds (croaring-rs).
+----------------------------+
| APPROXDISTINCT(test.value) |
+----------------------------+
| 630261 |
+----------------------------+
1 row in set. Query took 0.052 seconds.
```
So, choose [croaring-rs](https://github.com/saulius/croaring-rs) bitmap for
more efficient.
## What changes are included in this PR?
Add new `aggregate_function` called bitmap_distinct
## Are there any user-facing changes?
Maybe we can add one optimize rule to like `approx_median()`, change
`count(distinct x)` to `bitmap_distinct` in future
--
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]