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

feat: support histogram for equal condition #11297

Closed
wants to merge 9 commits into from

Conversation

xudong963
Copy link
Member

@xudong963 xudong963 commented May 4, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Summary about this PR

Closes #issue


This change is Reviewable

@vercel
Copy link

vercel bot commented May 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
databend ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2023 6:06am

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label May 4, 2023
@xudong963 xudong963 requested review from leiysky and Dousir9 May 4, 2023 01:08
@xudong963 xudong963 marked this pull request as draft May 4, 2023 01:28
@xudong963 xudong963 marked this pull request as ready for review May 4, 2023 02:44
let bucket_min = hist.buckets[idx - 1].upper_bound().to_double()?;
let bucket_max = bucket.upper_bound().to_double()?;
// If the bucket max is less than min, skip it
if bucket_max < min {
Copy link
Member

@Dousir9 Dousir9 May 5, 2023

Choose a reason for hiding this comment

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

Since bucket_max(upper_bound) is derived from col_stat.min and col_stat.max, so I think bucket_max < min will always be false.

let bucket_min = hist.buckets[idx - 1].upper_bound().to_double()?;
let bucket_max = bucket.upper_bound().to_double()?;
// If the bucket max is less than min, skip it
if bucket_max < const_value || bucket.num_distinct() == 0.0 {
Copy link
Member

Choose a reason for hiding this comment

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

bucket_max <= const_value, because the bucket range is [bucket_min, bucket_max).

continue;
}
// If the bucket min is greater than max, stop iteration
if bucket_min >= const_value {
Copy link
Member

Choose a reason for hiding this comment

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

bucket_min > const_value

@BohuTANG BohuTANG added the ci-benchmark Benchmark: run all test label May 6, 2023
@xudong963 xudong963 removed the ci-benchmark Benchmark: run all test label May 6, 2023
@xudong963
Copy link
Member Author

Will continue the ticket after #11332

@xudong963 xudong963 marked this pull request as draft May 6, 2023 06:13
@xudong963 xudong963 closed this Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants