Replies: 3 comments 6 replies
-
@alancai98 I was wondering if you or anybody from PartiQL team had any comments on this? I am specifically interested in learning about how "UTC is known, but the offset to local time is unknown" would be handled within PartiQL? Btw, I do not really have an issue if PartiQL team decides "-00:00" won't be handled as part of PartiQL value, and only the parsing capability would be provided to a TZ variant. |
Beta Was this translation helpful? Give feedback.
-
Hi, @rajivr . Thanks for going through the RFC.
This is correct. The RFC attempts for PartiQL TIMESTAMP type to unify the Ion Timestamp and Timestamp defined in SQL. While Alan @alancai98 will have more information on Rust Implementation's decision and timeline on Timestamp implementation, I can provide more context on the original intension of the RFC. So the RFC intended to preserve the unknown timezone property. The kotlin implementation has defined a dedicated object to hold this information.
The high level overview for datetime comparison are: If they represent the some point in time chronologically, they are considered equivalent. My mental model to build is to convert them to UTC time first, then make the comparison. So: Now for unknown timezone:
Consider: `TIMESTAMP '2023-06-01 00:00:00-00:00' This is to say that I know the time in UTC is So if we have We attempts to convert them to UTC time zone: the left hand side is already in UTC time zone, so the UTC time is for the right hand side, even though I don't know the local offset, I know that the UTC time is Given that the two UTC time are representing the same point in time, the two should be considered as equal. The kotlin implementation has a comparator implemented, you can take a look if you are interested. Let me know if this helps. If not, feel free to continue the discussion here. |
Beta Was this translation helpful? Give feedback.
-
I added an issue to PartiQL rust: partiql/partiql-lang-rust#444 |
Beta Was this translation helpful? Give feedback.
-
I am currently investigation how to design "sort keys" for datatime types.
In the PartiQL Datetime RFC, following is mentioned.
I am guessing this requirement stems from a similar requirement from Ion Timestamps.
Currently
partiql_value::DateTime
is defined as follows.Wouldn't we need to be able to capture information regarding "UTC is known, but the offset to local time is unknown" information within
DateTime
type?Maybe define
DateTime
type something likeIn this case the
None
variant would indicate that the time is UTC, but offset is unknown.Something else that I noticed is a minor inconsistency in the API design.
partiql_value::DateTime::from_hms_nano_tz
hastz_hours: Option<i8>
andtz_minutes: Option<i8>
as its parameters.partiql_value::DateTime::from_ymdhms_nano_offset_minutes
hasoffset: Option<i32>
.Do you think it might make sense to harmonize how offsets are passed to
DateTime
constructors?Beta Was this translation helpful? Give feedback.
All reactions