Skip to content

Support entropy in Aggregation function #12247

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Tracked by #12254
Weijun-H opened this issue Aug 30, 2024 · 6 comments
Closed
Tracked by #12254

Support entropy in Aggregation function #12247

Weijun-H opened this issue Aug 30, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@Weijun-H
Copy link
Member

Is your feature request related to a problem or challenge?

Calculates Shannon entropy of a column of values.

Describe the solution you'd like

D CREATE TABLE entropy (vals UInt32,strings String);
D INSERT INTO entropy VALUES (1, 'A'), (1, 'A'), (1,'A'), (1,'A'), (2,'B'), (2,'B'), (2,'C'), (2,'D');
D
D SELECT entropy(vals), entropy(strings) FROM entropy;
┌───────────────┬──────────────────┐
│ entropy(vals) │ entropy(strings) │
│    double     │      double      │
├───────────────┼──────────────────┤
│           1.0 │             1.75 │
└───────────────┴──────────────────┘

Describe alternatives you've considered

No response

Additional context

https://duckdb.org/docs/sql/functions/aggregates#entropyx
https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/entropy

@Weijun-H Weijun-H added the enhancement New feature or request label Aug 30, 2024
@Weijun-H Weijun-H changed the title Support entropy in Aggregation function Support entropy in Aggregation function Aug 30, 2024
@dharanad
Copy link
Contributor

Haven't worked on a problem like this before. I would like to give this a try.

@thinh2
Copy link
Contributor

thinh2 commented Aug 30, 2024

take

@alamb
Copy link
Contributor

alamb commented Sep 9, 2024

Given #12357 we may want to move this function to some other repo rather than the core

@thinh2
Copy link
Contributor

thinh2 commented Sep 11, 2024

thank for notify @alamb

@alamb
Copy link
Contributor

alamb commented Sep 16, 2024

Suggestion: #12254 (comment)

@alamb
Copy link
Contributor

alamb commented Sep 25, 2024

We are going to implement these in a different repository so closing this ticket to avoid: #12254 (comment)

@alamb alamb closed this as completed Sep 25, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants