pjmore commented on pull request #1208:
URL: https://github.com/apache/arrow-datafusion/pull/1208#issuecomment-956465243
@matthewmturner Ah that's what I get for not fully testing my suggestion.
The compilation error comes from an ownership issue.
```
let left: Box<Expr>;
let right: Box<Expr>;
match (left.as_ref(): &Expr, right.as_ref(): &Expr){
(col : &Expr, Expr::Literal(ScalarValue::Boolean(lit: &Option<bool>)))=>{
*left // What you had initially. Moving out of Box<Expr> gives Expr
*col // My suggestion. Moving out of immutable reference, not allowed
due to ownership rules
}
_ =>Expr::Binary{ //fallthrough pattern
left,
op: Operator::Or,
right
}
```
As far as I can tell without box patterns or some unnecessary allocations
in the fall-through pattern there isn't a way to do what I suggested. Sorry
about that, bad suggestion on my part.
--
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]