alamb commented on code in PR #5560:
URL: https://github.com/apache/arrow-datafusion/pull/5560#discussion_r1134191907
##########
datafusion/physical-expr/src/aggregate/median.rs:
##########
@@ -151,7 +151,12 @@ impl Accumulator for MedianAccumulator {
// ignore null values
.filter(|v| !v.is_null())
.cloned(),
- )?;
+ )
+ .map_err(|_| {
+ DataFusionError::Execution(
+ "median requires at least one non-null value".into(),
+ )
+ })?;
Review Comment:
I think so.
What about explicitly checking for all nulls with something like:
```rust
if !self.all_values
.iter()
.any(|v| !v.is_null()) {
.. raise error here
}
```
--
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]