rok commented on a change in pull request #9758:
URL: https://github.com/apache/arrow/pull/9758#discussion_r629179394
##########
File path: cpp/src/arrow/compute/kernels/aggregate_basic_internal.h
##########
@@ -256,8 +262,8 @@ struct MinMaxImpl : public ScalarAggregator {
using ScalarType = typename TypeTraits<ArrowType>::ScalarType;
std::vector<std::shared_ptr<Scalar>> values;
- if (!state.has_values ||
- (state.has_nulls && options.null_handling ==
MinMaxOptions::EMIT_NULL)) {
+ if (options.min_count > 0 &&
Review comment:
This is to satisfy [expected behavior in
R](https://stat.ethz.ch/R-manual/R-devel/library/base/html/Extremes.html): *The
minimum and maximum of a numeric empty set are +Inf and -Inf (in this order!)
which ensures transitivity, e.g., min(x1, min(x2)) == min(x1, x2).*
Perhaps it's better to fix this in R with a simple check.
--
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]