westonpace commented on issue #686:
URL:
https://github.com/apache/arrow-datafusion/issues/686#issuecomment-884452349
Does this seem correct?
Example | Output Arrow Type | Value | Output when printed
-- | -- | -- | --
to_timestamp('2021-07-20') | Timestamp(Nanoseconds, None) | nanos since unix
epic until 2021-07-20 local time | 2021-07-20T0
0:00:00
to_timestamp('2021-07-20+00:00') | Timestamp(Nanoseconds, None) | nanos
since unix epic until 2021-07-20 UTC | 2021-07-20T00:00:00
to_timestamp('2021-07-20+01:00') | Timestamp(Nanoseconds, None) | nanos
since unix epic until 2021-07-20 UTC+1 | 2021-07-19T23:00:00
to_timestamp('2021-07-20', 'UTC') | Timestamp(Nanoseconds, Utc) | nanos
since unix epic until 2021-07-20 local time | 2021-07-19T00:00:00Z
to_timestamp('2021-07-20+00:00', 'UTC') | Timestamp(Nanoseconds, Utc) |
nanos since unix epic until 2021-07-20 UTC | 2021-07-20T00:00:00Z
to_timestamp('2021-07-20+01:00', 'UTC') | Timestamp(Nanoseconds, Utc) |
nanos since unix epic until 2021-07-20 UTC | 2021-07-20T23:00:00Z
I think the one most interesting to me is row 4 so double check that one
(also not the presence/absence of a trailing Z to indicate local time or not).
By "output when printed" I mean what an implementation would get if it tried
to force the value into an ISO-8601 string.
Just a few extra thoughts...
Does `to_timestamp` only accept offsets in the strings (e.g. `+01:00` and
not tzdata strings or things like `MST`)? For reference, ISO-8601 only deals
with offsets.
Will Rust ever generate an Output Arrow Type with a time zone string (e.g.
MST)?
My point with the last two questions is that offset conversions aren't too
bad if you aren't handling tzdata strings. Once you do then you need a
timezone database which is a bit of a pain but solvable. The C++ impl recently
added compute kernels which rely on a timezone database and it's a non-trivial
effort. @rok has been spearheading this effort so you might reach out if you
go down this road.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]