alamb commented on issue #686:
URL: 
https://github.com/apache/arrow-datafusion/issues/686#issuecomment-884429679


   Let's make this concrete. Here is a proposal of what I think makes sense 
(and I think the consistent with @velvia's suggestion for a second argument). 
   
   The second argument simply serves to define the output type; Note to really 
make this useful we would also have to provide some way within Arrow and 
DataFusion to cast back and forth between different timestamps, doing the 
offset conversions appropriately
   
   | Example                                           | Output Arrow Type      
              |     Value
   | ------------------------------------------        | 
------------------------------------ | 
------------------------------------------------------
   | to_timestamp('2021-07-20')               | `Timestamp(Nanoseconds, None)`  
     | nanos since unix epic until 2021-07-20 local time
   | to_timestamp('2021-07-20+00:00')         | `Timestamp(Nanoseconds, None)`  
     | nanos since unix epic until 2021-07-20 UTC
   | to_timestamp('2021-07-20+01:00')         | `Timestamp(Nanoseconds, None)`  
     | nanos since unix epic until 2021-07-20 UTC+1
   | to_timestamp('2021-07-20', 'UTC')        | `Timestamp(Nanoseconds, Utc)`   
     | nanos since unix epic until 2021-07-20 local time
   | to_timestamp('2021-07-20+00:00', 'UTC')  | `Timestamp(Nanoseconds, Utc)`   
     | nanos since unix epic until 2021-07-20 UTC,
   | to_timestamp('2021-07-20+01:00', 'UTC')  | `Timestamp(Nanoseconds, Utc)`   
     | nanos since unix epic until 2021-07-20 UTC __NOTE only this timestamps 
value needs to be shifted to some other value to be relative to UTC__
   
   
   I think  @adamhooper 's point that "someone might get confused about what 
timezone the second argument is referring to"  at 
https://github.com/apache/arrow-datafusion/issues/686#issuecomment-875815801 is 
legitmate, but one we can handle with appropriate documentation.
   


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