waitingkuo commented on issue #4106:
URL: 
https://github.com/apache/arrow-datafusion/issues/4106#issuecomment-1304499949

   i think we might need to refactor the `return_type` to support dynamical 
time zone determine
   
https://github.com/apache/arrow-datafusion/blob/6d00bd990ce5644181ad1549a6c70c8406219070/datafusion/expr/src/function.rs#L221-L223
   
   `now()`'s return type is `TImestamp<TimeUnt, Some("+08:00")>` for now. need 
to get the timezone from config_options to and return `TImestamp<TimeUnt, 
Some("SOME_TIMEZONE")>` instead. I'll prefer move the `now()` support to 
another issue/pr. 
   
   i.e. 2. now() returns the Timestamp<TimeUnit::Nanosecond, 
Some("SOME_TIMEZONE") according to the time zone we have. it's currently fixed 
as "UTC"
   will be implemented in this pr. we can do this instead for now
   ```bash
   ❯ set time zone to '+08:00';
   0 rows in set. Query took 0.000 seconds.
   
   ❯ select now();
   +----------------------------------+
   | now()                            |
   +----------------------------------+
   | 2022-11-05T11:11:51.713660+00:00 |
   +----------------------------------+
   1 row in set. Query took 0.003 seconds.
   
   ❯ select now()::timestamptz;
   +----------------------------------+
   | now()                            |
   +----------------------------------+
   | 2022-11-05T19:11:14.245835+08:00 |
   +----------------------------------+
   1 row in set. Query took 0.003 seconds.
   ```


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