You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/27 13:15:48 UTC

[GitHub] [arrow-datafusion] alamb opened a new issue, #3981: Implement `current_date` Function

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

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   As we add more full featured date/time support for DataFusion users need to be able to use the current date to calculate things like "all data in the last 30 days" 
   
   **Describe the solution you'd like**
   Support the `current_date` postgres function https://www.postgresql.org/docs/8.2/functions-datetime.html
   
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features you've considered.
   
   **Additional context**
   This is a feature request we got from an early (internal) user of InfluxDB IOx
   
   I believe this is a good first issue as you can follow the existing implementation of  `now()` 
   - [ ] Physical support: https://github.com/apache/arrow-datafusion/blob/f1322592046a7ea895820286a2ad16d934540d92/datafusion/physical-expr/src/functions.rs#L424-L429) and use the same `query_execution_start_time` field
   - [ ] Tests: https://github.com/apache/arrow-datafusion/blob/beeb631d0bb979e9b6826f6cd3eae2d0a24f471e/datafusion/core/tests/sql/timestamp.rs#L417
   
   It would be a good exercise to add a new build in scalar function, physical planing support, and then tests in 
   


-- 
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-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-datafusion] tustvold commented on issue #3981: Implement `current_date` Function

Posted by GitBox <gi...@apache.org>.
tustvold commented on issue #3981:
URL: https://github.com/apache/arrow-datafusion/issues/3981#issuecomment-1295915958

   There is no command, just build the project as normal, the build script does the rest


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] avantgardnerio commented on issue #3981: Implement `current_date` Function

Posted by GitBox <gi...@apache.org>.
avantgardnerio commented on issue #3981:
URL: https://github.com/apache/arrow-datafusion/issues/3981#issuecomment-1295869135

   @tustvold I see you added [instructions for installing protoc](https://github.com/apache/arrow-datafusion/pull/3950/files#diff-3852a426279afbdc5e8b69e8ec4460bf9710d19d1553f0287e29766f9d2c473b)... would you mind adding the bash command you use to run it? :raised_hands: 


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] comphead commented on issue #3981: Implement `current_date` Function

Posted by GitBox <gi...@apache.org>.
comphead commented on issue #3981:
URL: https://github.com/apache/arrow-datafusion/issues/3981#issuecomment-1295925490

   Hi @tustvold 
   
   I have tried to build it first
   ```
   $ cargo build
   Compiling datafusion-proto v13.0.0 (arrow-datafusion/datafusion/proto)
   error[E0599]: no variant or associated item named `CurrentDate` found for enum `datafusion::ScalarFunction` in the current scope
       --> datafusion/proto/src/to_proto.rs:1181:57
        |
   1181 |             BuiltinScalarFunction::CurrentDate => Self::CurrentDate,
        |                                                         ^^^^^^^^^^^ variant or associated item not found in `datafusion::ScalarFunction`
        |
       ::: datafusion/proto/src/generated/prost.rs:1154:1
   ```
   If I go to prost.rs I dont see CurrentDate generated. I suppose `BuiltinScalarFunction` enum is the driver to generate new code?


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] comphead commented on issue #3981: Implement `current_date` Function

Posted by GitBox <gi...@apache.org>.
comphead commented on issue #3981:
URL: https://github.com/apache/arrow-datafusion/issues/3981#issuecomment-1295970804

   > Have you updated the protobuf definition in https://github.com/apache/arrow-datafusion/blob/master/datafusion/proto/proto/datafusion.proto ?
   
   Right, sorry, totally forgot about it! :-/


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] comphead commented on issue #3981: Implement `current_date` Function

Posted by GitBox <gi...@apache.org>.
comphead commented on issue #3981:
URL: https://github.com/apache/arrow-datafusion/issues/3981#issuecomment-1295629339

   @alamb please assign the task to me. 
   
   And let me know how to regenerate `prost.rs` locally to reflect latest changes for  Scalar types?


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] alamb closed issue #3981: Implement `current_date` Function

Posted by GitBox <gi...@apache.org>.
alamb closed issue #3981: Implement `current_date` Function
URL: https://github.com/apache/arrow-datafusion/issues/3981


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] tustvold commented on issue #3981: Implement `current_date` Function

Posted by GitBox <gi...@apache.org>.
tustvold commented on issue #3981:
URL: https://github.com/apache/arrow-datafusion/issues/3981#issuecomment-1295926664

   Have you updated the protobuf definition in https://github.com/apache/arrow-datafusion/blob/master/datafusion/proto/proto/datafusion.proto ?


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] alamb commented on issue #3981: Implement `current_date` Function

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #3981:
URL: https://github.com/apache/arrow-datafusion/issues/3981#issuecomment-1295809088

   Thanks @comphead 
   
   >  @alamb please assign the task to me.
   
   And let me know how to regenerate prost.rs locally to reflect latest changes for Scalar types?
   
   It may be related to https://github.com/apache/arrow-datafusion/issues/3947 / https://github.com/apache/arrow-datafusion/pull/3979 . Maybe @avantgardnerio  or @tustvold  have some ideas or a doc pointer
   


-- 
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-unsubscribe@arrow.apache.org

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