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

   ### Describe the bug
   
   Even though `Date64` can be cast into `Timestamp` inside 
[arrow-cast](https://github.com/apache/arrow-rs/blob/4d141a34cb2ab53c07cfd2255351348a830b0224/arrow-cast/src/cast.rs#L1961-L1978),
 DataFusion doesn't allow 
[this](https://github.com/apache/arrow-datafusion/blob/393e48f98872c696a90fce033fa584533d2326fa/datafusion/expr/src/type_coercion/binary.rs#L779-L832).
   
   ### To Reproduce
   
   ```sql
   ❯ select arrow_cast(now(), 'Date64') < arrow_cast('2022-02-02 02:02:02', 
'Timestamp(Nanosecond, None)');
   Error during planning: Cannot infer common argument type for comparison 
operation Date64 < Timestamp(Nanosecond, None)
   ```
   
   ### Expected behavior
   
   ```sql
   ❯ select arrow_cast(now(), 'Date64') < arrow_cast('2022-02-02 02:02:02', 
'Timestamp(Nanosecond, None)');
   +-------------------------------------+
   | now() < Utf8("2022-02-02 02:02:02") |
   +-------------------------------------+
   | false                               |
   +-------------------------------------+
   1 row in set. Query took 0.019 seconds.
   ```
   
   ### 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]

Reply via email to