-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is there a way to get a result similar to datediff
function
#7097
Comments
I agree that adding support for for intervals to |
I think this would be a good first issue as the wiring is all done and this would be a relatively simple extension to date_part I think |
For example, either use or follow https://docs.rs/arrow/latest/arrow/compute/fn.day.html |
Do we have plans to support date_diff, date_add and other time functions, @alamb such as comparing spark's udf function about |
There do not appear to be any such plans: https://github.com/apache/arrow-datafusion/issues?q=is%3Aissue+is%3Aopen+date_diff+ Adding them seems like a good idea to me. However, st some point we probably need to figure out how to split functions into packages so users can mix/match "packages" of functions they want without having to get all of the others. I filed #7110 to track this idea 🤔 |
I'd like to implement the following feature: select extract(~ from interval ~ ); |
Thanks @NiwakaDev -- let us know if you run into any trouble. |
As far as I understand, it seems like this issue depends on apache/arrow-rs#4969. |
@NiwakaDev I am not sure about this. Note DataFusion already supports What would |
Note there is an existing issue for implementing I've also put details in a comment there with comparison of other engines behaviour |
Is your feature request related to a problem or challenge?
I’d like to ask if there is a way to get a result similar to
datediff
function , also it seems that this function is not available in DataFusion.i try another way like this,but how can i get 6 days from interval result
Describe the solution you'd like
something like
date_diff
Describe alternatives you've considered
add udf like
date_diff
or
make
select extract(day from interval '1 days' );
work
Additional context
https://www.postgresql.org/docs/current/functions-datetime.html
https://github.com/apache/arrow-datafusion/blob/52cf58b46133d448e067455baab0faf8a50e565a/datafusion/expr/src/built_in_function.rs#L1021-L1032
https://github.com/apache/arrow-datafusion/blob/52cf58b46133d448e067455baab0faf8a50e565a/datafusion/physical-expr/src/datetime_expressions.rs#L729C1-L729C1
The text was updated successfully, but these errors were encountered: