Abdullahsab3 commented on issue #10308:
URL: https://github.com/apache/datafusion/issues/10308#issuecomment-2089994600

   I am testing some things out with the `at time zone` operator to understand 
it better. I think the UTC timestamp casting should be explictly specified 
first. Some context:
   
   Daylight savings in 2019 is in March 31 at 2AM in local time. 
   This is `2019-03-31T00:00:00` in UTC I think.
   
   The query `select '2019-03-31T02:00:00Z'::timestamp at time zone 
'Europe/Brussels';` seems to be ignoring the `Z` at the end, and it considers 
the timestamp local time.
   
   Some experiments:
   
   ```
   select '2019-03-31T02:00:00Z'::timestamp at time zone 'Europe/Brussels';
   
   result> Arrow error: Cast error: Cannot cast timezone to different timezone
   ```
   
   ```
   select '2019-03-31T00:00:00'::timestamp at time zone 'UTC' at time zone 
'Europe/Brussels'
   result> 2019-03-31T01:00:00+01:00
   ```
   
   ```
   select '2019-03-31T01:00:00'::timestamp at time zone 'UTC' at time zone 
'Europe/Brussels'
   result> 2019-03-31T03:00:00+02:00
   ```
   
   It seems to me that, regardless of the offset provided in the timestamp of 
the query, the timestamp will considered as a naive date time, and the 
additional timezone information that is provided in the query will be 
considered the source of truth.


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