StarRocks / starrocks

The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
https://starrocks.io
Apache License 2.0
8.94k stars 1.79k forks source link

percentile_approx: support values and weights #43615

Closed nagarajatantry closed 2 weeks ago

nagarajatantry commented 7 months ago

Feature request

Is your feature request related to a problem? Please describe. I have a map of values and weights. I want to use them to calculate the percentile. Something similar to what is supported in Athena/PrestoDB

approx_percentile(x, w, percentage) → [same as x][#](https://prestodb.io/docs/current/functions/aggregate.html#id10)
Returns the approximate weighed percentile for all input values of x using the per-item weight w at the percentage p. The weight must be an integer value of at least one. It is effectively a replication count for the value x in the percentile set. The value of p must be between zero and one and must be constant for all input rows.
kangkaisen commented 7 months ago

We will support it later

zhanglistar commented 7 months ago

Great! Clickhouse and gluten already have it.

github-actions[bot] commented 1 month ago

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!