Details
-
Task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
As specified in the design doc for TIMESTAMP types, the TIMESTAMP WITH LOCAL TIME ZONE type shall behave like the Instant class of Java, i.e., each value identifies a single time instant, but does not contain any explicit timezone information. To achieve this semantics, the processing of timestamp literals involves an implicit normalization from the session-local time zone to a predefined one (typically but not necessarily UTC), while displaying the stored timestamps involves an implicit conversion from the predefined time zone to the session-local one. Although a predefined time zone (typically UTC) was explicitly mentioned above, it is not a part of the individual values but of the definition of the whole type instead. As such, every value that gets stored has to be normalized to this predefined time zone and therefore its original time zone information gets lost.
For example, if the calendar and clock hanging on the wall shows 1969-07-20 16:17:39 according to Eastern Daylight Time, that must be stored as "1969-07-20 20:17:39", because that UTC time corresponds to the same instant. When reading that value back, we no longer know that it originated from an EDT time and we can only display it in some fixed time zone (either local or UTC or specified by the user).
This behaviour is consistent with some major DB engines, which is the best we can do as no type is defined by the SQL standard that would have this behaviour.
Attachments
Issue Links
- is a child of
-
HIVE-21348 Execute the TIMESTAMP types roadmap
- Open
- is a parent of
-
HIVE-21353 Use Instant instead of ZonedDateTime as the internal type for TIMESTAMP WITH LOCAL TIME ZONE
- Open
-
HIVE-21355 Parquet support for TIMESTAMP WITH LOCAL TIME ZONE
- Open
-
HIVE-21357 Avro support for TIMESTAMP WITH LOCAL TIME ZONE
- Open
-
HIVE-21358 ORC support for TIMESTAMP WITH LOCAL TIME ZONE
- Open