Spaarsh commented on issue #14303:
URL: https://github.com/apache/datafusion/issues/14303#issuecomment-2646433642
I this comment here (though erroneous) explains that this is the expected
behavior of the optimizer:
https://github.com/apache/datafusion/blob/9c12919786be0cfce5c4817101a
Spaarsh commented on issue #14303:
URL: https://github.com/apache/datafusion/issues/14303#issuecomment-2640583140
I think I have found out the main problem here. I added a few debugging
statements to print the DataTypes as the Optimizer code is running, here is
what I found:
```
> wit
jonahgao commented on issue #14303:
URL: https://github.com/apache/datafusion/issues/14303#issuecomment-2639882425
We might need to restrict this optimization to infallible casts, such as
when the cast target type is wider than the input expression.
--
This is an automated message from t
Spaarsh commented on issue #14303:
URL: https://github.com/apache/datafusion/issues/14303#issuecomment-2639831523
@alamb thanks! In order to test if that PR is casing this issue, I made a
separate branch and reverted the commit (e0f9f65) that merged that change into
main. The incorrect resu
alamb commented on issue #14303:
URL: https://github.com/apache/datafusion/issues/14303#issuecomment-2618972436
Possibly related to
- https://github.com/apache/datafusion/issues/14291
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on
Spaarsh commented on issue #14303:
URL: https://github.com/apache/datafusion/issues/14303#issuecomment-2614438204
I have analyzed the code in
[unwrap_cast_in_comparison.rs](https://github.com/apache/datafusion/blob/7c07948358eac81c4b297fa2400cba3c9ca55dc2/datafusion/optimizer/src/unwrap_cast
Spaarsh commented on issue #14303:
URL: https://github.com/apache/datafusion/issues/14303#issuecomment-2614438236
take
--
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 un
jonahgao opened a new issue, #14303:
URL: https://github.com/apache/datafusion/issues/14303
### Describe the bug
I found that `UnwrapCastInComparison` always assumes the cast operation can
succeed, but when it cannot, it results in incorrect optimization results.
### To Reprodu