Omega359 opened a new issue, #19024:
URL: https://github.com/apache/datafusion/issues/19024
### Is your feature request related to a problem or challenge?
### Is your feature request related to a problem or challenge?
Similar to #19022
```sql
> select ('2024-03-04'::date::timestamp + '05:21:34'::time) as t;
Error during planning: Cannot coerce arithmetic expression
Timestamp(Nanosecond, None) + Time64(Nanosecond) to valid types
```
This is a useful feature for allowing timestamp columns and time columns to
be added together into a new timestamp.
It seems to be missing from
[type_coercion](https://github.com/apache/datafusion/blob/5519b6145717aa974d13027409a48a286218d3a5/datafusion/expr-common/src/type_coercion/binary.rs#L1804)
however that code is used for both arithmetic and comparison so it's not
enough to just add a branch there and call it done.
Discussed in
[Discord](https://discord.com/channels/885562378132000778/1445080267906875402)
### Describe the solution you'd like
The sql should work correctly to add timestamp and time fields to get a new
field.
### Describe the solution you'd like
sql works as expected.
### Describe alternatives you've considered
```sql
select '2024-03-04'::date::timestamp + arrow_cast('05:21:34'::time::bigint,
'Duration(Nanosecond)') as t;
```
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]