westonpace edited a comment on issue #686:
URL: 
https://github.com/apache/arrow-datafusion/issues/686#issuecomment-884535402


   Aside: this case `to_timestamp('2021-07-20', 'UTC')` could be ambiguous if 
the server time zone happens to be in a DST shift.
   
   > I think this is consistent with what @westonpace has in his table
   
   Then I think what you have proposed matches (as best I can tell) the 
recently agreed upon spec so that is all good.  Usability-wise, I don't know, 
but I'll admit I don't have much stake in a usability decision (I'm more 
worried about interoperability).  So take this next paragraph with a grain of 
salt :laughing: 
   
   It feels to me like `to_timestamp` is doing two steps.  First, it is 
converting to a string to a Timestamp (respecting the offset in the string, if 
any).  Second, it is "reinterpret" casting (schema only change) that timestamp 
to the desired local/instant semantics.  I'd personally prefer something that 
breaks things into two steps if needed.
   
   Example | One Step Type | Two Step Equivalent | Two Step Type
   -- | -- | -- | --
   to_timestamp('1970-01-01') | Timestamp(Nanoseconds, None) | 
reinterpret_zone(to_timestamp('1970-01-01'), None) | Timestamp(Nanoseconds, 
None)
   to_timestamp('1970-01-01+00:00') | Timestamp(Nanoseconds, Utc) | 
reinterpret_zone(to_timestamp('1970-01-01+00:00'), None) | 
Timestamp(Nanoseconds, None)
   to_timestamp('1970-01-01+01:00') | Timestamp(Nanoseconds, +01:00) | 
reinterpret_zone(to_timestamp('1970-01-01+01:00'), None) | 
Timestamp(Nanoseconds, None)
   to_timestamp('1970-01-01', 'UTC') | Timestamp(Nanoseconds, None) | 
reinterpret_zone(to_timestamp('1970-01-01'), 'UTC') | Timestamp(Nanoseconds, 
Utc)
   to_timestamp('1970-01-01+00:00', 'UTC') | Timestamp(Nanoseconds, Utc) | 
reinterpret_zone(to_timestamp('1970-01-01+00:00', 'UTC'), 'Utc') | 
Timestamp(Nanoseconds, Utc)
   to_timestamp('1970-01-01+01:00', 'UTC') | Timestamp(Nanoseconds, +01:00) | 
reinterpret_zone(to_timestamp('1970-01-01+01:00'), 'UTC') | 
Timestamp(Nanoseconds, Utc)
   
   This would change the meaning of the fourth row so it would have the value 0.


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


Reply via email to