aweltsch opened a new issue, #13990:
URL: https://github.com/apache/datafusion/issues/13990
### Is your feature request related to a problem or challenge?
As part of the review for #13953 @2010YOUY01 brought up that some of the
error handling code in `datafusion/physical-expr/src/expressions/case.rs` can
be simplified, due to type checks being performed before evaluation.
This will clean-up and simplify the code a little bit.
### Describe the solution you'd like
Replace occurences similar to
```rust
DataFusionError::Context(
"WHEN expression did not return a BooleanArray".to_string(),
Box::new(e),
)
```
and
```rust
let expr = try_cast(Arc::clone(e), &batch.schema(),
return_type.clone())
.unwrap_or_else(|_| Arc::clone(e));
```
with code that returns an internal error directly
### Describe alternatives you've considered
_No response_
### Additional context
Link to suggestions from the review:
- https://github.com/apache/datafusion/pull/13953#discussion_r1900547926
- https://github.com/apache/datafusion/pull/13953#discussion_r1900548407
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]