liukun4515 commented on issue #1356:
URL:
https://github.com/apache/arrow-datafusion/issues/1356#issuecomment-978791177
> I agree that the `coercion` framework is a bit messy at the moment. It
might help to start refactoring by collecting the coercion logic into a single
module with some clearly defined entrypoint.
>
> Perhaps something like
>
> ```rust
> pub fn coerce_to(expr: Expr, to_type: &DataType) -> Option<Expr> {
> ...
> }
> ```
>
> With appropriate comments and tests
Now all the coercion logic are in one the rule file, and it can't fit many
case. For example
```
select abs('123');
select '123'+10;
select 12.3+'1.23';
....
```
Now all the coercion logic are in one the rule file, and it can't fit many
case. For example
I think we can create a new mod for coercion and type inferring.
The new mod should be `pub crate` and should not public to out of the
`datafusion` crate.
I think we should create diff coercion rule for diff expr type, and we can
summary the common logic to the same file.
In the AggFunction, ScalarFuntion, ScalarUDF, we can define diff coercion to
fit each expr and operation.
--
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]