Skip to content

Support entropy in Aggregation function #12247

Closed

Description

@Weijun-H

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

Activity

  1. changed the title [-]Support entropy in Aggregation function[/-] [+]Support `entropy` in Aggregation function[/+] on Aug 30, 2024
  2. dharanad commented on Aug 30, 2024

    @dharanad
    Contributor

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

  3. thinh2 commented on Aug 30, 2024

    @thinh2
    Contributor

    take

  4. alamb commented on Sep 9, 2024

    @alamb
    Contributor

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

  5. thinh2 commented on Sep 11, 2024

    @thinh2
    Contributor

    thank for notify @alamb

  6. alamb commented on Sep 16, 2024

    @alamb
    Contributor

    Suggestion: #12254 (comment)

  7. alamb commented on Sep 25, 2024

    @alamb
    Contributor

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

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions