alamb opened a new issue #251:
URL: https://github.com/apache/arrow-datafusion/issues/251


   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   I want to write queries that have predicates on relative timeranges like 
"the last 1 hour" or "the last 2 days"
   
   **Describe the solution you'd like**
   I would like a new function `now()` that takes no arguments and returns a 
`DataType::Timestamp(TimeUnit::Nanoseconds, NULL)` of the current timestamp 
   
   It should follow the postgres semantics described in 
https://www.postgresql.org/docs/current/functions-datetime.html
   
   ```
   now ( ) → timestamp with time zone
   Current date and time (start of current transaction); see Section 9.9.4
   ```
   
   Bonus points for adding SQL standard functions 
https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
 such as `CURRENT_TIME` and `CURRENT_TIMESTAMP`.
   
   **Describe alternatives you've considered**
   N/A
   
   **Additional context**
   I imagine this is largely an exercise in creating a new built in function 
`now()` and calling `chrono::Utc::now()` to get the current time:
   
   https://docs.rs/chrono/0.4.19/chrono/offset/struct.Utc.html#method.now
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to