lidavidm commented on a change in pull request #11152:
URL: https://github.com/apache/arrow/pull/11152#discussion_r710108171



##########
File path: cpp/src/arrow/compute/kernels/aggregate_basic.cc
##########
@@ -282,6 +282,43 @@ Result<std::unique_ptr<KernelState>> 
MinMaxInit(KernelContext* ctx,
   return visitor.Create();
 }
 
+// For "min" and "max" functions: dispatch to the MinMax kernel.
+Result<std::unique_ptr<KernelState>> MinOrMaxInit(KernelContext* ctx,
+                                                  const KernelInitArgs& args) {
+  std::vector<ValueDescr> inputs = args.inputs;
+
+  ARROW_ASSIGN_OR_RAISE(auto func, 
GetFunctionRegistry()->GetFunction("min_max"));

Review comment:
       Since we register min_max first, I've changed it to just pass the 
function to the init function, skipping the second lookup.

##########
File path: docs/source/cpp/compute.rst
##########
@@ -198,6 +198,10 @@ the input to a single output value.
 
+---------------+-------+-------------+------------------------+----------------------------------+-------+
 | mean          | Unary | Numeric     | Scalar Decimal/Float64 | 
:struct:`ScalarAggregateOptions` |       |
 
+---------------+-------+-------------+------------------------+----------------------------------+-------+
+| max           | Unary | Numeric     | Scalar Struct          | 
:struct:`ScalarAggregateOptions` |       |

Review comment:
       Thanks. I also fixed the output type column.




-- 
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]


Reply via email to