Skip to content

feat(datetime): support date_bin literal origins for range locality - #7

Draft
benbellick wants to merge 2 commits into
mainfrom
feat/date-bin-literal-origin-locality
Draft

benbellick wants to merge 2 commits into
mainfrom
feat/date-bin-literal-origin-locality

Conversation

@benbellick

Copy link
Copy Markdown
Owner

Which issue does this PR close?

Closes apache#26913.

Rationale for this change

An explicit origin currently prevents date_bin from 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_bin aggregations 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support range-key locality analysis for date_bin with a literal origin

1 participant