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

[jira] [Commented] (HIVE-21073) Remove Extra String Object

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

Andrew Sherman commented on HIVE-21073:
---------------------------------------

From Java 8 those string concatenations [are actually done with a StringBuffer under the covers|http://www.pellegrino.link/2015/08/22/string-concatenation-with-java-8.html].

 

> Remove Extra String Object
> --------------------------
>
>                 Key: HIVE-21073
>                 URL: https://issues.apache.org/jira/browse/HIVE-21073
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 4.0.0, 3.1.1
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Trivial
>         Attachments: HIVE-21073.1.patch
>
>
> {code}
>   public static String generatePath(Path baseURI, String filename) {
>     String path = new String(baseURI + Path.SEPARATOR + filename);
>     return path;
>   }
>   public static String generateFileName(Byte tag, String bigBucketFileName) {
>     String fileName = new String("MapJoin-" + tag + "-" + bigBucketFileName + suffix);
>     return fileName;
>   }
> {code}
> It's a bit odd to be performing string concatenation and then wrapping the results in a new string.  This is creating superfluous String objects. 



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