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

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

     [ https://issues.apache.org/jira/browse/ARROW-10051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Pitrou resolved ARROW-10051.
------------------------------------
    Fix Version/s: 2.0.0
       Resolution: Fixed

Issue resolved by pull request 8232
[https://github.com/apache/arrow/pull/8232]

> [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
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.0.0
>
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> 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)