mapleFU commented on code in PR #43799:
URL: https://github.com/apache/arrow/pull/43799#discussion_r1730027887
##########
cpp/src/arrow/compute/kernels/aggregate_basic.cc:
##########
@@ -532,13 +532,13 @@ struct BooleanAnyImpl : public ScalarAggregator {
}
if (batch[0].is_scalar()) {
const Scalar& scalar = *batch[0].scalar;
- this->has_nulls = !scalar.is_valid;
- this->any = scalar.is_valid && checked_cast<const
BooleanScalar&>(scalar).value;
- this->count += scalar.is_valid;
+ this->has_nulls |= !scalar.is_valid;
Review Comment:
1. If previous is `has_null`, it always has_null ( that's why using `|=` )
2. `!scalar.is_valid` means has-null, so it would set by this
--
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]