Skip to content
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

Return date/time in UTC in JMX connector #5488

Conversation

findepi
Copy link
Member

@findepi findepi commented Oct 9, 2020

Using server zone introduces ambiguity problem during DST change.
Presto engine has no problem representing and distinguishing
(point-in-time, zone) pairs regardless of DST. However, due to
how they are formatted for the client, client can no longer distinguish
values within summer→winter DST change.

In the example below, rows with increment 1 and 2 represent different
point in time, but are rendered the same for the client.

presto> SELECT
     ->     increment,
     ->     from_unixtime(base + increment * 3600, 'America/Los_Angeles')
     -> FROM (VALUES(1572766200)) t(base)
     -> CROSS JOIN UNNEST(sequence(0, 3)) u(increment);
     ->
 increment |                    _col1
-----------+---------------------------------------------
         0 | 2019-11-03 00:30:00.000 America/Los_Angeles
         1 | 2019-11-03 01:30:00.000 America/Los_Angeles
         2 | 2019-11-03 01:30:00.000 America/Los_Angeles
         3 | 2019-11-03 02:30:00.000 America/Los_Angeles
(4 rows)

Using server zone introduces ambiguity problem during DST change.
Presto engine has no problem representing and distinguishing
`(point-in-time, zone)` pairs regardless of DST.  However, due to
how they are formatted for the client, client can no longer distinguish
values within summer→winter DST change.

In the example below, rows with `increment` 1 and 2 represent different
point in time, but are rendered the same for the client.

```
presto> SELECT
     ->     increment,
     ->     from_unixtime(base + increment * 3600, 'America/Los_Angeles')
     -> FROM (VALUES(1572766200)) t(base)
     -> CROSS JOIN UNNEST(sequence(0, 3)) u(increment);
     ->
 increment |                    _col1
-----------+---------------------------------------------
         0 | 2019-11-03 00:30:00.000 America/Los_Angeles
         1 | 2019-11-03 01:30:00.000 America/Los_Angeles
         2 | 2019-11-03 01:30:00.000 America/Los_Angeles
         3 | 2019-11-03 02:30:00.000 America/Los_Angeles
(4 rows)
```
@findepi findepi merged commit 098d419 into trinodb:master Oct 9, 2020
@findepi findepi added this to the 344 milestone Oct 9, 2020
@findepi findepi deleted the findepi/return-date-time-in-utc-in-jmx-connector-5cc97b branch October 9, 2020 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants