Conversation
|
This, combined with #3965 and corresponding changes to the Union DataType we can get |
alamb
left a comment
There was a problem hiding this comment.
This looks like a good idea to me.
To ease the API transition for people can we please add some doc strings / examples for how to construct such a variant? If you are into Arc<str> it seems obvious but I remember it was somewhat confusing at first for a Rust newcomer
Perhaps we could add convenience methods to construct these variants like
impl DataType {
fn new_timestamp(timeunit: .., timezone: impl Into<Arc<str>>) -> Self {
}Or something
cc @maxburke and @jhorstmann and @viirya and @waitingkuo given this is a non trivial API change
I'd rather avoid these as it results in a slightly confused API surface, but I will add some documentation to the variant itself |
Adding docs is a good start -- and we can always add a new method in the future if that would help |
Which issue does this PR close?
Relates to #3955
Rationale for this change
Timezones are very often constant over a large number of types, e.g. if part of a session global default timezone. Maintaining separate allocations for every timestamp is therefore incredibly wasteful.
I originally wanted to propose storing Tz but this led to two major issues:
Switching to
Arc<str>allows reusing the same allocation whilst also reducing the size of the variantWhat changes are included in this PR?
Are there any user-facing changes?