jorisvandenbossche commented on a change in pull request #8294:
URL: https://github.com/apache/arrow/pull/8294#discussion_r504419732
##########
File path: cpp/src/arrow/compute/api_aggregate.h
##########
@@ -142,6 +142,20 @@ Result<Datum> MinMax(const Datum& value,
const MinMaxOptions& options = MinMaxOptions::Defaults(),
ExecContext* ctx = NULLPTR);
+/// \brief Test whether any element in a boolean array evaluates to true.
+///
+/// This function returns true if any of the elements in the array evaluates
+/// to true and false otherwise. Null values are taken to evaluate to false.
Review comment:
> Sorry yes. The examples were for all. Just to make sure I understand,
with kleene logic, we emit null if there's a null anywhere in the input
No, we only emit null if the presence of the null (the fact that it could be
either True or False) would influence the result:
```
any_kleene([true, null]) = true
any_kleene([false, null]) = null
all_kleene([true, null]) = null
all_kleene([false, null]) = false
```
But, the above is only when *not* skipping nulls (because with the default
of skipping, there is no difference with non-kleene logic)
See the links I mentioned in
https://github.com/apache/arrow/pull/8294#issuecomment-701357437, and also the
Julia docs have a good explanation of three-valued (Kleene) logic:
https://docs.julialang.org/en/v1/manual/missing/index.html#Logical-operators-1
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]