fix: Remove !=0 check from supports_collect_by_thresholds#20730
Open
jonathanc-n wants to merge 5 commits intoapache:mainfrom
Open
fix: Remove !=0 check from supports_collect_by_thresholds#20730jonathanc-n wants to merge 5 commits intoapache:mainfrom
!=0 check from supports_collect_by_thresholds#20730jonathanc-n wants to merge 5 commits intoapache:mainfrom
Conversation
Contributor
Author
|
cc @gabotechs |
Dandandan
reviewed
Mar 5, 2026
Co-authored-by: Daniël Heres <danielheres@gmail.com>
alamb
reviewed
Mar 10, 2026
| // them as unknown, `Absent` will return None (this is in regards to why | ||
| // `!=0` is not checked) | ||
| if let Some(byte_size) = stats.total_byte_size.get_value() { | ||
| *byte_size != 0 && *byte_size < threshold_byte_size |
Contributor
There was a problem hiding this comment.
when would byte size ever be zero ? This seems like if the size was zero something is wrong 🤔
Contributor
Author
There was a problem hiding this comment.
Byte size can be zero if working on empty table/partition or if filter exec filters down to zero rows.
This PR just removes this check as it is not longer a problem due to the addition of Precision (this check was added 2 years ago). This sanity check was previously here because getting statistics with limit would unwrap to zero (which would now be Absent)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Small change to remove the TODO + != 0 check. Since the commit was made two years ago, statistics have been changed to use Precision. Exact(0) and inexact(0) are now valid stats while absent will evaluate to false
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?