apache / apache/datafusion

`approx_distinct` should be leveraging dictionary encoding to support faster counting for these types

Open
#1,115 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**

A challenge to improve `approx_distinct`, which should be leveraging dictionary encoding to support faster counting for these types.

**Describe the solution you'd like**

Making sure we can use the cardinality of the dictionary to speed up.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Start by locating the Rust implementation of `approx_distinct` and the dictionary-encoding code paths in DataFusion. Determine which supported types expose dictionary cardinality and define completion as using that cardinality to make counting faster, with coverage for the affected types.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.