You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/07/07 00:50:12 UTC
(datafusion) branch gh-readonly-queue/main/pr-23333-0365d3c2631eea73f2889c197506fdfb3895fd3e created (now f755cb44fa)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-23333-0365d3c2631eea73f2889c197506fdfb3895fd3e
in repository https://gitbox.apache.org/repos/asf/datafusion.git
at f755cb44fa feat: Support BinaryView type in approx_distinct (#23333)
This branch includes the following new commits:
new f755cb44fa feat: Support BinaryView type in approx_distinct (#23333)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org
(datafusion) 01/01: feat: Support BinaryView type in approx_distinct (#23333)
Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-23333-0365d3c2631eea73f2889c197506fdfb3895fd3e
in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit f755cb44fa33c69837a8774be862fbfe01e7a100
Author: Michael Kleen <mk...@gmail.com>
AuthorDate: Tue Jul 7 02:49:52 2026 +0200
feat: Support BinaryView type in approx_distinct (#23333)
## Which issue does this PR close?
- Relates to https://github.com/apache/datafusion/issues/22989 but does
not close it. More types are coming.
## Rationale for this change
- Support the `BinaryView` type for `approx_distinct`
- The Arrow type `BinaryView` can be directly supported for
`HLLAccumulator` and `HllGroupsAccumulator`
## What changes are included in this PR?
- Enable `HLLAccumulator` and `HllGroupsAccumulator` to support
`BinaryView`
- Tests for the non-grouped and grouped path as part of `aggregate.slt`
## Are these changes tested?
Yes
## Are there any user-facing changes?
Yes, `approx_distinct` supports now `BinaryView` but no breaking
changes.
---
datafusion/functions-aggregate/src/approx_distinct.rs | 2 ++
datafusion/sqllogictest/test_files/aggregate.slt | 17 +++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/datafusion/functions-aggregate/src/approx_distinct.rs b/datafusion/functions-aggregate/src/approx_distinct.rs
index 3b74d3b714..a8dbd8611d 100644
--- a/datafusion/functions-aggregate/src/approx_distinct.rs
+++ b/datafusion/functions-aggregate/src/approx_distinct.rs
@@ -798,6 +798,7 @@ impl AggregateUDFImpl for ApproxDistinct {
| DataType::LargeUtf8
| DataType::Utf8View
| DataType::Binary
+ | DataType::BinaryView
| DataType::LargeBinary => Box::new(HLLAccumulator::new()),
DataType::Null => {
Box::new(NoopAccumulator::new(ScalarValue::UInt64(Some(0))))
@@ -866,6 +867,7 @@ fn is_hll_groups_type(data_type: &DataType) -> bool {
| DataType::LargeUtf8
| DataType::Utf8View
| DataType::Binary
+ | DataType::BinaryView
| DataType::LargeBinary
)
}
diff --git a/datafusion/sqllogictest/test_files/aggregate.slt b/datafusion/sqllogictest/test_files/aggregate.slt
index 7f538a9bfe..37ee3d8a95 100644
--- a/datafusion/sqllogictest/test_files/aggregate.slt
+++ b/datafusion/sqllogictest/test_files/aggregate.slt
@@ -1936,6 +1936,23 @@ SELECT g, approx_distinct(arrow_cast(s, 'Utf8View')) FROM approx_distinct_group_
3 0
4 1
+# BinaryView non-grouped
+query I
+SELECT approx_distinct(arrow_cast(arrow_cast(s, 'Binary'), 'BinaryView')) FROM approx_distinct_group_test WHERE g = 2;
+----
+2
+
+
+# BinaryView grouped
+query II
+SELECT g, approx_distinct(arrow_cast(arrow_cast(s, 'Binary'), 'BinaryView')) FROM approx_distinct_group_test GROUP BY g ORDER BY g;
+----
+1 2
+2 2
+3 0
+4 1
+
+
# Integers (Int32): group 1 -> {10,20}=2, group 2 -> {30,40}=2, group 3 -> 0, group 4 -> {50}=1
query II
SELECT g, approx_distinct(i) FROM approx_distinct_group_test GROUP BY g ORDER BY g;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org