WinkerDu opened a new issue, #2609:
URL: https://github.com/apache/arrow-datafusion/issues/2609
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
There is bug when binary mathematical operators `+`, `-`, `*`, `/`, `%` work
with literal `NULL`
**To reproduce**
```
> select column1 + NULL from (VALUES (1, 2.3), (2, 5.4)) as t
Plan("'Int64 + Null' can't be evaluated because there isn't a common type to
coerce the types to")
```
Postgres works like
```
# select column1 + NULL from (VALUES (1, 2.3), (2, 5.4)) as t;
?column?
----------
(2 rows)
```
**Describe the solution you'd like**
- Adjusts `mathematics_numerical_coercion` in `binary_rule.rs`, make it work
well on condition that at most one side of lhs or rhs is NULL
- Enhances `compute_op_scalar` macro in `binary.rs` to produce NULL array
when scalar value is `NULL`
**Describe alternatives you've considered**
No.
**Additional context**
--
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]