-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add TimestampWithOffset canonical extension type
#8743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add TimestampWithOffset canonical extension type
#8743
Conversation
westonpace
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems pretty straightforward and reasonable
TimestampWithOffset extension typeTimestampWithOffset extension type
|
There are several TODOs in this PRs description. Is that intended? |
|
@alamb We're currently still discussing the FORMAT in the For
Realistically, even after the FORMAT PR goes into the spec I think this will take me a few more weeks to fully flesh out. |
|
Thanks for the clarification @serramatutu -- I'll mark it as a draft again then |
…48002) ### Rationale for this change Closes #44248 Arrow has no built-in canonical way of representing the `TIMESTAMP WITH TIME ZONE` SQL type, which is present across multiple different database systems. Not having a native way to represent this forces users to either convert to UTC and drop the time zone, which may have correctness implications, or use bespoke workarounds. A new `arrow.timestamp_with_offset` extension type would introduce a standard canonical way of representing that information. Rust implementation: apache/arrow-rs#8743 Go implementation: apache/arrow-go#558 [DISCUSS] [thread in the mailing list](https://lists.apache.org/thread/yhbr3rj9l59yoxv92o2s6dqlop16sfnk). ### What changes are included in this PR? Proposal and documentation for `arrow.timestamp_with_offset` canonical extension type. ### Are these changes tested? N/A ### Are there any user-facing changes? Yes, this is an extension to the arrow format. * GitHub Issue: #44248 --------- Co-authored-by: David Li <li.davidm96@gmail.com> Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Co-authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
d187bb9 to
f6cda58
Compare
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me -- thank you @serramatutu and @westonpace
| /// The extension type for `TimestampWithOffset`. | ||
| /// | ||
| /// <https://arrow.apache.org/docs/format/CanonicalExtensions.html#timestamp-with-offset> | ||
| TimestampWithOffset(TimestampWithOffset), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a pub enum, unfortunately this will need to wait until the next major arrow release (in Jan):
TimestampWithOffset extension typeTimestampWithOffset canonical extension type
|
Looks like we got a CI flake and need to rerun:
|
This commit adds a new `TimestampWithOffset` extension type. This type represents a timestamp column that stores potentially different timezone offsets per value. The timestamp is stored in UTC alongside the original timezone offset in minutes.
ab316a4 to
3efea23
Compare
|
Rebased onto main. |
Which issue does this PR close?
Implement
arrow.timestamp_with_offsetcanonical extension type.Rationale for this change
Be compliant with Arrow spec: apache/arrow#48002
What changes are included in this PR?
This commit adds a new
TimestampWithOffsetextension type. This type represents a timestamp column that stores potentially different timezone offsets per value. The timestamp is stored in UTC alongside the original timezone offset in minutes.Are these changes tested?
Yes.
Are there any user-facing changes?
Yes, this is a new canonical extension type.