You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2020/04/13 23:51:00 UTC
[jira] [Updated] (HIVE-23194) Use Queue Instead of List for
CollectOperator
[ https://issues.apache.org/jira/browse/HIVE-23194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Mollitor updated HIVE-23194:
----------------------------------
Attachment: HIVE-23194.1.patch
> Use Queue Instead of List for CollectOperator
> ---------------------------------------------
>
> Key: HIVE-23194
> URL: https://issues.apache.org/jira/browse/HIVE-23194
> Project: Hive
> Issue Type: Improvement
> Reporter: David Mollitor
> Assignee: David Mollitor
> Priority: Minor
> Attachments: HIVE-23194.1.patch
>
>
> https://github.com/apache/hive/blob/d6948a28ab3e34e5116591a60a96bdf031185e47/ql/src/java/org/apache/hadoop/hive/ql/exec/CollectOperator.java#L85-L88
> {code:java|title=CollectOperator.java}
> rowList = new ArrayList<Object>();
> ...
> } else {
> result.o = rowList.remove(0);
> result.oi = standardRowInspector;
> }
> {code}
> Removing from the head of an {{ArrayList}} is an expensive operation because it needs to shift all of the elements down in the array for each call. Better to use a {{Queue}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)