Skip to content
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

Merged

Conversation

skrzypo987
Copy link
Member

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:

# Section
* Add quantile_at_value function

Copy link
Member

@Praveen2112 Praveen2112 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits

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)"))
Copy link
Member

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.

Copy link
Member Author

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.

@skrzypo987 skrzypo987 force-pushed the skrzypo/270-quantile-at-value branch from 77a92ad to 27d75c0 Compare March 27, 2023 12:05
@skrzypo987 skrzypo987 requested a review from Praveen2112 March 27, 2023 12:05
Copy link
Member

@kokosing kokosing left a 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.

@skrzypo987 skrzypo987 force-pushed the skrzypo/270-quantile-at-value branch from 27d75c0 to a5be8b9 Compare March 28, 2023 04:44
@skrzypo987 skrzypo987 force-pushed the skrzypo/270-quantile-at-value branch from a5be8b9 to d0d6da4 Compare March 28, 2023 13:19
@skrzypo987
Copy link
Member Author

Commits squashed.
I don't know if red CI is just flakiness. Should I rerun?

@Praveen2112
Copy link
Member

I think Clickhouse PTs are flaky - have created an issue for that - #16772. Post re-running it was green.

@Praveen2112 Praveen2112 merged commit 6158839 into trinodb:master Mar 29, 2023
@Praveen2112
Copy link
Member

Thank you for adding the new functions.

@github-actions github-actions bot added this to the 411 milestone Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants