bkietz commented on a change in pull request #9621: URL: https://github.com/apache/arrow/pull/9621#discussion_r592443814
########## File path: cpp/src/arrow/compute/exec.cc ########## @@ -838,6 +838,13 @@ class ScalarAggExecutor : public KernelExecutorImpl<ScalarAggregateKernel> { private: Status Consume(const ExecBatch& batch) { + if (kernel_->nomerge) { + kernel_->consume(kernel_ctx_, batch); + ARROW_CTX_RETURN_IF_ERROR(kernel_ctx_); + return Status::OK(); + } Review comment: This is a confusing aspect of the KernelExecutor contract which should be documented: `KernelExecutor::Init` initializes the executor but assumes that the kernel's `init` has already been called in the provided `KernelContext`. This is to facilitate the case where `init` may be expensive and does not need to be called again for each execution of the kernel, for example the same lookup table can be re-used for all scanned batches in a dataset filter. I'll add a comment clarifying this. ---------------------------------------------------------------- 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: us...@infra.apache.org