-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add quantile_at_value function #16736
Add quantile_at_value function #16736
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits
core/trino-main/src/test/java/io/trino/operator/aggregation/TestQuantileDigestFunctions.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/scalar/QuantileDigestFunctions.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/test/java/io/trino/operator/aggregation/TestQuantileDigestFunctions.java
Outdated
Show resolved
Hide resolved
QuantileDigest qdigest = new QuantileDigest(1); | ||
addAll(qdigest, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); | ||
assertThat(assertions | ||
.expression(format("quantile_at_value(CAST(a AS qdigest(bigint)), 20)")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have a round-trip assertion here - based on the result from quantile_at_value
- we could use it to apply value_at_quantile
function and check if they are same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excelent idea. Added as another commit.
77a92ad
to
27d75c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would squash these commits.
27d75c0
to
a5be8b9
Compare
Co-authored-by: Peizhen Guo <[email protected]>
a5be8b9
to
d0d6da4
Compare
Commits squashed. |
I think Clickhouse PTs are flaky - have created an issue for that - #16772. Post re-running it was green. |
Thank you for adding the new functions. |
Description
Additional context and related issues
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text: