agavra opened a new pull request, #9949:
URL: https://github.com/apache/pinot/pull/9949

   **NOTE**: this is technically a backwards incompatible change, but the 
previous behavior was bogus so I hope this is OK (if you were to try to use it 
the way it's documented it would return completely wrong values)
   
   The original code returned incorrect values (the hours were basically mod 
24, instead of returning negative when it should).
   
   Confirmed behavior with Postgres (note that postgres just returns the 
current timezone because all timestamps are stored in UTC, it uses the UTC 
timestamp to figure out if it's daylight savings or standard time):
   
   ```sql
   set timezone='America/Toronto';
   SELECT EXTRACT(timezone_hour FROM TIMESTAMP WITH TIME ZONE '2022-01-01 
6:23:01-08') FROM foo;
    extract
   ---------
         -5
   SELECT EXTRACT(timezone_hour FROM TIMESTAMP WITH TIME ZONE '2022-07-01 
6:23:01-08') FROM foo;
    extract
   ---------
         -4
   (1 row)
   ----------------------------------------
   ----------------------------------------
   
   set timezone='Etc/GMT+12';
   SELECT EXTRACT(timezone_hour FROM TIMESTAMP WITH TIME ZONE '2022-01-01 
6:23:01-08') FROM foo;
    extract
   ---------
        -12
   (1 row)
   ----------------------------------------
   ----------------------------------------
   
   set timezone='Asia/Shanghai';
   SELECT EXTRACT(timezone_hour FROM TIMESTAMP WITH TIME ZONE '2022-07-01 
6:23:01-08') FROM foo;
    extract
   ---------
          8
   (1 row)
   ```


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to