You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Omega359 (via GitHub)" <gi...@apache.org> on 2024/01/27 16:09:31 UTC
[I] Add a make_date function [arrow-datafusion]
Omega359 opened a new issue, #9024:
URL: https://github.com/apache/arrow-datafusion/issues/9024
### Is your feature request related to a problem or challenge?
Currently there isn't a way to make a date from separate component fields without doing a fair bit of work along the lines of:
```
arrow_cast(to_timestamp_seconds(concat(col(date_year), '-', lpad(arrow_cast(col(date_month), 'Utf8'), 2, '0'), '-', lpad(arrow_cast(col(date_day), 'Utf8'), 2, '0'), 'T00:00:00.000Z')), 'Date32')
```
A function with the same signature as the [postgresql](https://www.postgresql.org/docs/16/functions-datetime.html) or [spark ](https://spark.apache.org/docs/latest/api/sql/#make_date) would be a useful addition.
### Describe the solution you'd like
A make_date(year, month, day) function that would take expressions for all arguments with a return type of Date32 for dataframes, Date for SQL.
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
--
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
Re: [I] Add a make_date function [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #9024:
URL: https://github.com/apache/arrow-datafusion/issues/9024#issuecomment-1913576381
Thanks @Omega359 !
BTW I am not sure if you are interested, but https://github.com/apache/arrow-datafusion/issues/8282 contains a list of tickets we have gathered relating to date/time issues
--
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
Re: [I] Add a make_date function [arrow-datafusion]
Posted by "Omega359 (via GitHub)" <gi...@apache.org>.
Omega359 commented on issue #9024:
URL: https://github.com/apache/arrow-datafusion/issues/9024#issuecomment-1913256004
> A similar request (make interval) is #6951
I can work on that one after I complete this one.
--
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
Re: [I] Add a make_date function [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #9024:
URL: https://github.com/apache/arrow-datafusion/issues/9024#issuecomment-1913251864
A similar request (make interval) is https://github.com/apache/arrow-datafusion/issues/6951
--
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