-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Percentile Aggregate Functions #13
Comments
Definitely something we are also looking forward too. We use percentile for so many of our statistics and charts. This is the only thing that is stopping us from using Rockset. |
You can emulate this functionality with the NTH_VALUE window function. |
This worked for me:
@benhannel can you see any issue with that approach? Would there be any way to avoid the repetition of:
throughout the query? |
Yes, the approach you have there will work. You can also use a subquery to avoid some duplication of It's worth noting that any mechanism to compute an exact percentile value will take memory which is linear in the number of input rows. Max and standard deviation are much cheaper to compute, if sufficient for your use case. |
Is your feature request related to a problem? Please describe.
It would be very useful to add a percentile aggregation function, in addition to the standard min, max, avg. When performing analysis it's often a requirement to report p95, p99 values, it's not easy to do so right now.
Describe the solution you'd like
Adding something like
[MIN|MAX]_PCT(<percentile>, <column>)
would be ideal, to be used likeMAX_PCT(99, value)
,MIN_PCT(20, value)
etc.The text was updated successfully, but these errors were encountered: