Skip to content

docs: explain date_bin daylight saving behavior - #26041

Open
Prajwal-k-tech wants to merge 1 commit into
apache:mainfrom
Prajwal-k-tech:prajwal/25168-date-bin-dst
Open

Prajwal-k-tech wants to merge 1 commit into
apache:mainfrom
Prajwal-k-tech:prajwal/25168-date-bin-dst

Conversation

@Prajwal-k-tech

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

An explicit date_bin origin anchors buckets to an instant. For timezone-aware timestamps, an origin aligned with local midnight can therefore move to 01:00 after a daylight saving transition. The issue confirms this behavior matches PostgreSQL and DuckDB; the missing piece is documenting the tradeoff and the local-time alternatives.

What changes are included in this PR?

  • Clarify that date_bin uses a fixed origin and does not adjust it for daylight saving changes.
  • Point users to date_trunc for calendar units and to to_local_time for binning other intervals against local wall-clock boundaries.
  • Regenerate the SQL scalar-function reference from the canonical function documentation.

This PR was prepared with AI assistance. The source change, generated reference, issue reproductions, and project checks were reviewed for consistency.

What is the testing strategy for this PR?

This is a documentation-only change, so no runtime tests were added. Verified generated docs with ./dev/update_function_docs.sh and ./ci/scripts/check_generated_docs.sh; also ran cargo +1.99.0 fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, ./ci/scripts/doc_prettier_check.sh --write --allow-dirty, and git diff --check.

Are there any user-facing changes?

Yes. The date_bin reference now explains fixed-origin behavior across DST and documents alternatives for local calendar boundaries.

Copilot AI balanced review requested due to automatic review settings October 4, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added documentation Improvements or additions to documentation functions Changes to functions implementation labels Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document that date_bin with an explicit origin drifts an hour across a DST transition

2 participants