You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Yibo Cai (Jira)" <ji...@apache.org> on 2020/09/21 05:10:00 UTC

[jira] [Created] (ARROW-10051) [C++][Compute] Make aggregate kernel merge state mutable

Yibo Cai created ARROW-10051:
--------------------------------

             Summary: [C++][Compute] Make aggregate kernel merge state mutable
                 Key: ARROW-10051
                 URL: https://issues.apache.org/jira/browse/ARROW-10051
             Project: Apache Arrow
          Issue Type: Improvement
          Components: C++
            Reporter: Yibo Cai
            Assignee: Yibo Cai


Aggregate kernel _consumes_ each batch and output a _state_, which is then _merged_ with other batches. Currently, _state_ parameter is defined as _const KernelState&_ in merge interface. It may cause unnecessary data copying for kernels with non-trivial states.
 E.g., mode kernel maintains a value:count map in its _state_ structure, it's better to move the map than copy it (for merge operation of the first batch).

Aggregate kernel code template is at [1]. _batch_state_ is an auto variable(line 873), modifying it in kernel->merge() is okay (line 888).

[1] https://github.com/apache/arrow/blob/a17717fa528bb7d495cfba5c6b5fb67866934a63/cpp/src/arrow/compute/exec.cc#L871-L891



--
This message was sent by Atlassian Jira
(v8.3.4#803005)