You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2023/04/01 22:54:48 UTC
[GitHub] [arrow-datafusion] Jefffrey opened a new issue, #5828: case when expressions that aren't boolean castable cause panic
Jefffrey opened a new issue, #5828:
URL: https://github.com/apache/arrow-datafusion/issues/5828
### Describe the bug
Given case expression in following form:
```sql
CASE
WHEN x1 THEN y1
WHEN x2 THEN y2
ELSE y3
END
```
Then all `xN` (`x1`, `x2`) should be boolean expressions and should be coerced to a boolean type if not, otherwise throw an error without causing a panic.
### To Reproduce
On latest main:
```bash
jeffrey:~/Code/arrow-datafusion/datafusion-cli$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.30s
Running `/media/jeffrey/1tb_860evo_ssd/.cargo_target_cache/debug/datafusion-cli`
DataFusion CLI v21.0.0
❯ select CASE WHEN 1 THEN null ELSE 10 END as col;
thread 'main' panicked at 'WHEN expression did not return a BooleanArray: Internal("could not cast value to arrow_array::array::boolean_array::BooleanArray")', /home/jeffrey/Code/arrow-datafusion/datafusion/physical-expr/src/expressions/case.rs:199:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
jeffrey:~/Code/arrow-datafusion/datafusion-cli$
```
### Expected behavior
Should either succeed, or throw error without panic
### Additional context
Will be fixed by https://github.com/apache/arrow-datafusion/pull/5820
--
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: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb closed issue #5828: case when expressions that aren't boolean data type cause panic
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #5828: case when expressions that aren't boolean data type cause panic
URL: https://github.com/apache/arrow-datafusion/issues/5828
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org