Skip to content

Commit 1c1b90b

Browse files
committed
Documenting any/all as kleen when skip_null=True.
1 parent 7ffd873 commit 1c1b90b

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

cpp/src/arrow/compute/api_aggregate.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ Result<Datum> MinMax(
202202
///
203203
/// This function returns true if any of the elements in the array evaluates
204204
/// to true and false otherwise. Null values are ignored by default.
205+
/// If null values are taken into account by setting ScalarAggregateOptions
206+
/// parameter skip_nulls = false then kleen logic is applied.
205207
///
206208
/// \param[in] value input datum, expecting a boolean array
207209
/// \param[in] options see ScalarAggregateOptions for more information
@@ -220,6 +222,8 @@ Result<Datum> Any(
220222
///
221223
/// This function returns true if all of the elements in the array evaluate
222224
/// to true and false otherwise. Null values are ignored by default.
225+
/// If null values are taken into account by setting ScalarAggregateOptions
226+
/// parameter skip_nulls = false then kleen logic is applied.
223227
///
224228
/// \param[in] value input datum, expecting a boolean array
225229
/// \param[in] options see ScalarAggregateOptions for more information

docs/source/cpp/compute.rst

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,25 +186,25 @@ Aggregations
186186
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
187187
| Function name | Arity | Input types | Output type | Options class |
188188
+==========================+============+====================+=======================+============================================+
189-
| all | Unary | Boolean | Scalar Boolean | :struct:`ScalarAggregateOptions` |
189+
| all | Unary | Boolean | Scalar Boolean (1) | :struct:`ScalarAggregateOptions` |
190190
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
191-
| any | Unary | Boolean | Scalar Boolean | :struct:`ScalarAggregateOptions` |
191+
| any | Unary | Boolean | Scalar Boolean (1) | :struct:`ScalarAggregateOptions` |
192192
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
193193
| count | Unary | Any | Scalar Int64 | :struct:`ScalarAggregateOptions` |
194194
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
195195
| index | Unary | Any | Scalar Int64 | :struct:`IndexOptions` |
196196
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
197197
| mean | Unary | Numeric | Scalar Float64 | :struct:`ScalarAggregateOptions` |
198198
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
199-
| min_max | Unary | Numeric | Scalar Struct (1) | :struct:`ScalarAggregateOptions` |
199+
| min_max | Unary | Numeric | Scalar Struct (2) | :struct:`ScalarAggregateOptions` |
200200
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
201-
| mode | Unary | Numeric | Struct (2) | :struct:`ModeOptions` |
201+
| mode | Unary | Numeric | Struct (3) | :struct:`ModeOptions` |
202202
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
203-
| quantile | Unary | Numeric | Scalar Numeric (3) | :struct:`QuantileOptions` |
203+
| quantile | Unary | Numeric | Scalar Numeric (4) | :struct:`QuantileOptions` |
204204
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
205205
| stddev | Unary | Numeric | Scalar Float64 | :struct:`VarianceOptions` |
206206
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
207-
| sum | Unary | Numeric | Scalar Numeric (4) | :struct:`ScalarAggregateOptions` |
207+
| sum | Unary | Numeric | Scalar Numeric (5) | :struct:`ScalarAggregateOptions` |
208208
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
209209
| tdigest | Unary | Numeric | Scalar Float64 | :struct:`TDigestOptions` |
210210
+--------------------------+------------+--------------------+-----------------------+--------------------------------------------+
@@ -213,18 +213,23 @@ Aggregations
213213

214214
Notes:
215215

216-
* \(1) Output is a ``{"min": input type, "max": input type}`` Struct.
216+
* \(1) If null values are taken into account by setting ScalarAggregateOptions
217+
parameter skip_nulls = false then `Kleene logic`_ logic is applied.
217218

218-
* \(2) Output is an array of ``{"mode": input type, "count": Int64}`` Struct.
219+
* \(2) Output is a ``{"min": input type, "max": input type}`` Struct.
220+
221+
* \(3) Output is an array of ``{"mode": input type, "count": Int64}`` Struct.
219222
It contains the *N* most common elements in the input, in descending
220223
order, where *N* is given in :member:`ModeOptions::n`.
221224
If two values have the same count, the smallest one comes first.
222225
Note that the output can have less than *N* elements if the input has
223226
less than *N* distinct values.
224227

225-
* \(3) Output is Float64 or input type, depending on QuantileOptions.
228+
* \(4) Output is Float64 or input type, depending on QuantileOptions.
229+
230+
* \(5) Output is Int64, UInt64 or Float64, depending on the input type.
226231

227-
* \(4) Output is Int64, UInt64 or Float64, depending on the input type.
232+
.. _Kleene logic: https://en.wikipedia.org/wiki/Three-valued_logic#Kleene_and_Priest_logics
228233

229234
Element-wise ("scalar") functions
230235
---------------------------------

0 commit comments

Comments
 (0)