You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Laszlo Bodor (JIRA)" <ji...@apache.org> on 2018/06/28 12:12:00 UTC

[jira] [Commented] (HIVE-20015) Populate ArrayList with Constructor

    [ https://issues.apache.org/jira/browse/HIVE-20015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16526253#comment-16526253 ] 

Laszlo Bodor commented on HIVE-20015:
-------------------------------------

+1 LGTM

> Populate ArrayList with Constructor
> -----------------------------------
>
>                 Key: HIVE-20015
>                 URL: https://issues.apache.org/jira/browse/HIVE-20015
>             Project: Hive
>          Issue Type: Improvement
>          Components: HiveServer2
>    Affects Versions: 3.0.0, 4.0.0
>            Reporter: BELUGA BEHR
>            Assignee: Daniel Voros
>            Priority: Trivial
>              Labels: newbie, noob
>         Attachments: HIVE-20015.1.patch
>
>
> {code:title=MapWork.java}
>   public ArrayList<Operator<?>> getWorks() {
>     return new ArrayList<Operator<?>>(aliasToWork.values());
>   }
>   public ArrayList<Path> getPaths() {
>     ArrayList<Path> ret=new ArrayList<>();
>     ret.addAll(pathToAliases.keySet());
>     return ret;
>   }
> {code}
> {{getWorks}} method correctly uses the constructor to populate the {{ArrayList}}.  Please update {{getPaths}} method to do the same, instead of creating an empty array, then creating a new array to accommodate the {{addAll}} request.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)