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

Fix: panics in approx_percentile_cont() aggregate function #11934

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

2010YOUY01
Copy link
Contributor

Which issue does this PR close?

Closes #11871.
Closes #11870.
Closes #11869.

Rationale for this change

There are several crashed bugs in approx_median()/approx_percentile_cont()/approx_percentile_cont_with_weight()
Those functions all rely on ApproxPercentileAccumulator for implementation.

This PR includes an edge case fix within ApproxPercnetileAccumulator, and more details can be found in the comments.

What changes are included in this PR?

Are these changes tested?

sqllogictests, note 3 added test cases are equivalent to the ones reported in issues, but they are further reduced.

Are there any user-facing changes?

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Aug 11, 2024
@alamb alamb changed the title Fix: crash bugs in approx_percentile_cont() aggregate function Fix: panics in approx_percentile_cont() aggregate function Aug 11, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- thank you @2010YOUY01 (and SQLancer!)

@Dandandan Dandandan merged commit 64a9280 into apache:main Aug 11, 2024
25 checks passed
@2010YOUY01 2010YOUY01 deleted the fix-approx-median branch August 12, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sqllogictest SQL Logic Tests (.slt)
Projects
None yet
3 participants