Repository navigation
Add ZonedTimestamp{P,Z}: a UTC Timestamp in a named time zone - #5
Merged
Merged
Conversation
- `ZonedTimestamp{P,Z}` stores one `utc::Timestamp{P}` and names its zone with
the Symbol type parameter `Z`, so a column has the 8-byte layout of an Arrow
timestamp with a time zone and reinterprets to and from Arrow buffers in place.
- Comparison, hashing, subtraction, and time-period arithmetic use the UTC time
and work for every zone name. Local fields, date-period arithmetic, rounding,
and adjusters use zone rules: "UTC" and "+HH:MM"/"-HH:MM" offsets are built
in, and the new DurationsTimeZonesExt supplies every name TimeZones.jl knows,
plus conversions and comparisons with ZonedDateTime.
- A repeated local time throws AmbiguousTimeError unless `occurrence` picks one;
a skipped one throws NonExistentTimeError. Text is RFC 9557 style:
"2026-11-01T01:30:00-07:00[America/Denver]".
- DurationsArrowExt writes ZonedTimestamp columns as Arrow timestamps with time
zone String(Z), tagged JuliaLang.Durations.ZonedTimestamp.
- Tests compare the zone rules of all 597 TimeZones.jl zones with ZonedDateTime.
Next to a zero-length transition (5 zones) TimeZones.jl reports existing local
times as nonexistent, so those cases are pinned to Python zoneinfo values.
- The trim workload covers UTC and fixed-offset zones.
- Version 1.3.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
quinnj
force-pushed
the
jq/zoned-timestamp
branch
from
September 25, 2026 05:03
81e15c8 to
1c64bd1
Compare
quinnj
marked this pull request as ready for review
September 25, 2026 20:11
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.
Adds
Durations.ZonedTimestamp{P,Z}for Arrow timestamps with a timezone. It stores oneutc::Timestamp{P}field;Zis the zone name as aSymbol. For each of Arrow's four timestamp units, values are 8-byteisbitsand preserve everyInt64count, including unknown zone names.The storage split follows Arrow's timestamp specification: an absent or empty zone uses
Timestamp{P}for local clock time; a nonempty zone, includingUTC, usesZonedTimestamp{P,Z}for a UTC instant. Changing a nonempty zone changes metadata, not the stored count. Nullability remains in Arrow's validity bitmap.Behavior
ZonedTimestamp{P,Z}(ts)interprets local time;(ts, UTC)stores UTC. The correspondingTimestamp(zt)/Timestamp(zt, UTC)conversions are explicit.Timestamp,DateTime, orDate.reprround-trips even on older Dates parsers.Arrow integration
The Arrow 2.x adapter preserves both types through extension metadata. Arrow 3.x can load Durations without that legacy adapter. The native reader/writer mappings belong in apache/arrow-julia#609; this PR does not change that branch or claim that its public facade already returns these types.
test/arrow3.jlchecks the actual #609 IPC reader/writer with typed buffers, all four units, absent/empty/UTC/fixed/named/unknown zones, file and stream formats, nulls, and extreme counts. It runs instead of the Arrow 2.x adapter tests when the test environment has Arrow 3.x.Validation
Rebased on the released Durations 1.3.0 implementation. No version bump or Timestamp implementation changes are included.
51ccbcc: 8,321 checks passed, including 482 Arrow 3 IPC/storage checks.1c64bd1: eight platform/version jobs plus trim compilation and execution.Original implementation prepared with Claude Code.
Co-authored by Codex