lidavidm commented on a change in pull request #10942:
URL: https://github.com/apache/arrow/pull/10942#discussion_r692053961
##########
File path: cpp/src/arrow/compute/kernels/aggregate_basic.cc
##########
@@ -297,11 +310,13 @@ struct BooleanAnyImpl : public ScalarAggregator {
const auto& other = checked_cast<const BooleanAnyImpl&>(src);
this->any |= other.any;
this->has_nulls |= other.has_nulls;
+ this->count += other.count;
return Status::OK();
}
Status Finalize(KernelContext* ctx, Datum* out) override {
- if (!options.skip_nulls && !this->any && this->has_nulls) {
+ if ((!options.skip_nulls && !this->any && this->has_nulls) ||
+ this->count < options.min_count) {
Review comment:
Yes, it looked weird to me as well, but that is how [Kleene
logic](https://en.wikipedia.org/wiki/Three-valued_logic#Kleene_and_Priest_logics)
works, and you can observe this in R:
```r
> any(c(NA), na.rm = FALSE)
[1] NA
> any(c(NA, TRUE), na.rm = FALSE)
[1] TRUE
> any(c(NA, FALSE), na.rm = FALSE)
[1] NA
> any(c(), na.rm = FALSE)
[1] FALSE
```
--
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]