Skip to content

feat: support dictionary in approx_distinct - #24731

Closed
Rich-T-kid wants to merge 2 commits into
apache:mainfrom
Rich-T-kid:rich-T-kid/support-approx-distinct-dictionary
Closed

feat: support dictionary in approx_distinct#24731
Rich-T-kid wants to merge 2 commits into
apache:mainfrom
Rich-T-kid:rich-T-kid/support-approx-distinct-dictionary

Conversation

@Rich-T-kid

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

see #24730

What changes are included in this PR?

Two lines of change in approx_distinct.rs:

  1. Add DataType::Dictionary(_, _) => Box::new(HLLAccumulator::new()) arm in accumulator()
  2. Add DataType::Dictionary(_, _) to the is_hll_groups_type match

Are these changes tested?

yes, 1 test was added.

Are there any user-facing changes?

yes, approx-distinct(dictionary) will no longer panic.

@github-actions github-actions Bot added the functions Changes to functions implementation label Aug 27, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.45%. Comparing base (2a7a1e3) to head (6335771).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...afusion/functions-aggregate/src/approx_distinct.rs 95.83% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #24731    +/-   ##
========================================
  Coverage   81.44%   81.45%            
========================================
  Files        1120     1120            
  Lines      401605   401817   +212     
  Branches   401605   401817   +212     
========================================
+ Hits       327098   327282   +184     
- Misses      55348    55359    +11     
- Partials    19159    19176    +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nuno-faria

Copy link
Copy Markdown
Contributor

Thanks @Rich-T-kid, but it appears @mkleen already has a PR to add this at #24646. Maybe you could help review that PR.

@saadtajwar saadtajwar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - LGTM!

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

Thanks @Rich-T-kid, but it appears @mkleen already has a PR to add this at #24646. Maybe you could help review that PR.

@nuno-faria thanks for letting me know

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support Dictionary types in approx_distinct

4 participants