[
https://issues.apache.org/jira/browse/ARROW-9873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17185760#comment-17185760
]
Yibo Cai commented on ARROW-9873:
---------------------------------
Hi [~apitrou], aggregation kernel should implement MergeFrom operation, kind of
confused what it does.
[Consume|https://github.com/apache/arrow/blob/7ce498e3db6bd755cf2fd5a1b532a0d7276496de/cpp/src/arrow/compute/kernels/aggregate_mode.cc#L117-L135]
can creates map or counting based "state" object per (max - min).
[MergeFrom|https://github.com/apache/arrow/blob/7ce498e3db6bd755cf2fd5a1b532a0d7276496de/cpp/src/arrow/compute/kernels/aggregate_mode.cc#L137-L140]
merges this "state" with another "state", so they must be the same type.
I'm not sure if below situation will happen:
- In Consume, int32, max-min is small, so we created counting based "state"
- In MergeFrom, int32, the input "state" is map based, so they cannot merge
> [C++][Compute] Improve mode kernel for intergers within limited value range
> ---------------------------------------------------------------------------
>
> Key: ARROW-9873
> URL: https://issues.apache.org/jira/browse/ARROW-9873
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++
> Reporter: Yibo Cai
> Assignee: Yibo Cai
> Priority: Major
> Attachments: mode-range-skylake.png
>
>
> It's possible to improve mode kernel performance for integers within limited
> value range by using a value indexed array instead of general hash table.
> Similar trick is used in sorting kernel ARROW-1571.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)