hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naveen Gangam (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-16890) org.apache.hadoop.hive.serde2.io.HiveVarcharWritable - Adds Superfluous Wrapper
Date Fri, 01 Dec 2017 21:11:00 GMT

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

Naveen Gangam updated HIVE-16890:
---------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.0
           Status: Resolved  (was: Patch Available)

Fix has been committed to master. Thank you for your contribution [~belugabehr]

> org.apache.hadoop.hive.serde2.io.HiveVarcharWritable - Adds Superfluous Wrapper
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-16890
>                 URL: https://issues.apache.org/jira/browse/HIVE-16890
>             Project: Hive
>          Issue Type: Improvement
>          Components: Serializers/Deserializers
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Trivial
>             Fix For: 3.0.0
>
>         Attachments: HIVE-16890.1.patch, HIVE-16890.1.patch, HIVE-16890.1.patch
>
>
> Class {{org.apache.hadoop.hive.serde2.io.HiveVarcharWritable}} creates a superfluous
wrapper and then immediately unwraps it.  Don't bother wrapping in this scenario.
> {code}
>   public void set(HiveVarchar val, int len) {
>     set(val.getValue(), len);
>   }
>   public void set(String val, int maxLength) {
>     value.set(HiveBaseChar.enforceMaxLength(val, maxLength));
>   }
>   public HiveVarchar getHiveVarchar() {
>     return new HiveVarchar(value.toString(), -1);
>   }
>   // Here calls getHiveVarchar() which creates a new HiveVarchar object with a string
in it
>   // The object is passed to set(HiveVarchar val, int len)
>   //  The string is pulled out
>   public void enforceMaxLength(int maxLength) {
>     // Might be possible to truncate the existing Text value, for now just do something
simple.
>     if (value.getLength()>maxLength && getCharacterLength()>maxLength)
>       set(getHiveVarchar(), maxLength);
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message