mkmik opened a new issue, #2785:
URL: https://github.com/apache/arrow-datafusion/issues/2785

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   Datafusion supports a few date parts like "year" or "seconds" in the 
`EXTRACT` operator.
   
   Postgres offers a few more. In particular it offers an `EPOCH` date part 
which extracts the number of seconds since 1970-01-01 00:00:00-00 (can be 
negative). 
   
   See https://www.postgresql.org/docs/8.1/functions-datetime.html
   
   My particular use case is using pre-existing grafana postgres plugin, which 
crafts queries with such a construct. But I think it would be generally useful 
to support converting a timestamp to a unix epoch.
   
   **Describe the solution you'd like**
   
   ```sql
   select EXTRACT(EPOCH from column) from mytable;
   ```
   
   **Describe alternatives you've considered**
   
   ```sql
   select CAST(column AS bigint)/1000000000 from mytable;
   ```
   
   


-- 
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: github-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to