pitrou commented on a change in pull request #10994:
URL: https://github.com/apache/arrow/pull/10994#discussion_r695992451
##########
File path: cpp/src/arrow/compute/kernels/hash_aggregate.cc
##########
@@ -824,6 +824,36 @@ Status AddHashAggKernels(
return Status::OK();
}
+template <typename Type, typename ConsumeValue, typename ConsumeNull>
+void VisitGroupedValues(const ExecBatch& batch, ConsumeValue&& valid_func,
+ ConsumeNull&& null_func) {
+ auto g = batch[1].array()->GetValues<uint32_t>(1);
+ if (batch[0].is_array()) {
+ VisitArrayValuesInline<Type>(
+ *batch[0].array(),
+ [&](typename TypeTraits<Type>::CType val) { valid_func(*g++, val); },
Review comment:
We may capture explicitly when lifetime is at stake, e.g. an async code
where it's important to delineate what exactly needs to survive past the
enclosing scope. Here, the callable is just executed synchronously, listing
every capture explicitly is more of a nuisance (both for typing and
readability-wise).
--
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]