felipecrv commented on code in PR #15083:
URL: https://github.com/apache/arrow/pull/15083#discussion_r1072713980
##########
cpp/src/arrow/compute/exec/aggregate.cc:
##########
@@ -121,27 +127,48 @@ Result<Datum> GroupBy(const std::vector<Datum>&
arguments, const std::vector<Dat
ExecSpanIterator argument_iterator;
ExecBatch args_batch;
- if (!arguments.empty()) {
- ARROW_ASSIGN_OR_RAISE(args_batch, ExecBatch::Make(arguments));
+ std::optional<int64_t> inferred_length = ExecBatch::InferLength(arguments);
+ if (!inferred_length.has_value()) {
+ inferred_length = ExecBatch::InferLength(keys);
+ }
+ DCHECK(inferred_length.has_value());
Review Comment:
Yes. The length should always be inferrable from the `keys`.
--
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]