Weijun-H opened a new issue, #12247: URL: https://github.com/apache/datafusion/issues/12247
### Is your feature request related to a problem or challenge? Calculates [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_(information_theory)) 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 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
