Repository navigation
feat(datetime): support date_bin literal origins for range locality - #7
Draft
benbellick wants to merge 2 commits into
Draft
benbellick wants to merge 2 commits into
benbellick wants to merge 2 commits into
Conversation
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?
Closes apache#26913.
Rationale for this change
An explicit origin currently prevents
date_binfrom reusing range partitioning for aggregation, even when its buckets align with every range split.What changes are included in this PR?
Admit non-null literal origins while retaining timezone-less nanosecond timestamps and positive fixed-duration, month-free strides. A fixed origin shifts the buckets without changing their nondecreasing behavior. The existing boundary proof still rejects crossing buckets and evaluation errors.
What is the testing strategy for this PR?
SQLLogicTests check plans and results for explicit epoch, shifted-aligned, and crossing origins. Unit tests cover rejected arguments, ascending/descending splits, and fail-closed boundary errors.
Are there any user-facing changes?
More aligned
date_binaggregations can avoid a hash shuffle. No function-result or public API changes.Note: This PR was developed with AI assistance. All changes have been reviewed, and I take full responsibility for this contribution.