Skip to content

Implement count distinct for dictionary arrays#256

Merged
alamb merged 4 commits intoapache:masterfrom
alamb:alamb/distinct_dict
May 6, 2021
Merged

Implement count distinct for dictionary arrays#256
alamb merged 4 commits intoapache:masterfrom
alamb:alamb/distinct_dict

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented May 4, 2021

Which issue does this PR close?

Closes #249

Rationale for this change

I have dictionary encoded data that I want to be able to compute distinct counts

What changes are included in this PR?

This implementation has the the basic "get it working" version. A more optimized implementation (e.g. only looking at the dictionary contents) is left for a subsequent PR and #258 tracks better performance

Are there any user-facing changes?

queries like select count(distinct tag_col) from ... are now supported when tag_col is a dictionary encoded column

Copy link
Contributor

@Dandandan Dandandan left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@alamb alamb merged commit 27be271 into apache:master May 6, 2021
@alamb alamb deleted the alamb/distinct_dict branch May 6, 2021 18:14
@houqp houqp added the enhancement New feature or request label Jul 31, 2021
unkloud pushed a commit to unkloud/datafusion that referenced this pull request Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COUNT DISTINCT does not support dictionary types

3 participants