Skip to content

fix(driver): support extended datetime ranges with chrono - #797

Open
TCeason wants to merge 2 commits into
databendlabs:mainfrom
TCeason:fix-chrono-datetime-ranges
Open

fix(driver): support extended datetime ranges with chrono#797
TCeason wants to merge 2 commits into
databendlabs:mainfrom
TCeason:fix-chrono-datetime-ranges

Conversation

@TCeason

@TCeason TCeason commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace Jiff-backed timestamps with Chrono to fix decoding failures and
silent Arrow clamping near Databend's timestamp bounds.

  • Preserve 9999-12-31 23:59:59.999999 UTC, microsecond precision, and
    explicit TIMESTAMP_TZ offsets.
  • Handle local year 10000 produced by timezone conversion without
    expanding the server's accepted UTC range.
  • Update formatting, parameter serialization, and Python/Node.js bindings.

Compatibility

This is a breaking Rust API change, intended for release 0.35.0:

  • Timestamp variants now contain Chrono DateTime values.
  • ResultFormatSettings::timezone now uses chrono_tz::Tz.
  • Remove the zoned_to_chrono_* conversion helpers.

Existing row conversions to NaiveDateTime and DateTime<Tz> remain
supported. Python/Node.js retain their native datetime/Date types and
existing range/precision limits. Far-future DST behavior follows
chrono-tz and may differ from Jiff.

Validation

Validated against Databend Query v1.2.911-nightly-3b719621c4:

Link: databendlabs/databend#20425

  • Datetime integration tests pass over HTTP JSON, HTTP Arrow, and
    Flight SQL (UTC boundary coverage for Flight SQL).
  • Rust formatting, Clippy, and Python/Node.js compilation checks pass,
    including Python cp38.

TCeason and others added 2 commits September 8, 2026 17:25
Replace Jiff-backed timestamp values and session timezones with chrono and chrono-tz to preserve the SQL timestamp bounds, including local year 10000 after timezone conversion. Remove Arrow timestamp clamping without expanding the server's accepted UTC range.

Preserve UTC NaiveDateTime conversion and fold/gap disambiguation. Update formatting, parameter serialization, and Python/Node.js bindings. Add focused boundary, offset, nested timestamp, DST, and Arrow regression coverage plus a server integration test. Far-future DST calculations follow chrono-tz and may differ from Jiff.

BREAKING CHANGE: Value timestamp variants now contain chrono DateTime values, and ResultFormatSettings::timezone uses chrono_tz::Tz. Remove zoned_to_chrono_datetime and zoned_to_chrono_fixed_offset; callers can use the stored chrono values directly.
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.

1 participant