You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "BELUGA BEHR (JIRA)" <ji...@apache.org> on 2017/06/27 03:20:00 UTC

[jira] [Updated] (HIVE-16970) General Improvements To org.apache.hadoop.hive.metastore.cache.CacheUtils

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

BELUGA BEHR updated HIVE-16970:
-------------------------------
    Description: 
# Simplify
# Do not initiate empty collections
# Parsing is incorrect:

{code:title=org.apache.hadoop.hive.metastore.cache.CacheUtils}
  public static String buildKey(String dbName, String tableName, List<String> partVals) {
    String key = buildKey(dbName, tableName);
    if (partVals == null || partVals.size() == 0) {
      return key;
    }
    for (int i = 0; i < partVals.size(); i++) {
      key += partVals.get(i);
      if (i != partVals.size() - 1) {
        key += delimit;
      }
    }
    return key;
  }

public static Object[] splitPartitionColStats(String key) {
// ...
}
{code}

The result of passing the key to the "split" method is:

{code}
buildKey("db","Table",["Part1","Part2","Part3"], "col");
[db, tablePart1, [Part2, Part3], col]
// "table" and "Part1" is mistakenly concatenated
{code}

  was:
# Simplify
# Do not initiate empty collections


> General Improvements To org.apache.hadoop.hive.metastore.cache.CacheUtils
> -------------------------------------------------------------------------
>
>                 Key: HIVE-16970
>                 URL: https://issues.apache.org/jira/browse/HIVE-16970
>             Project: Hive
>          Issue Type: Improvement
>          Components: Metastore
>    Affects Versions: 3.0.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Trivial
>
> # Simplify
> # Do not initiate empty collections
> # Parsing is incorrect:
> {code:title=org.apache.hadoop.hive.metastore.cache.CacheUtils}
>   public static String buildKey(String dbName, String tableName, List<String> partVals) {
>     String key = buildKey(dbName, tableName);
>     if (partVals == null || partVals.size() == 0) {
>       return key;
>     }
>     for (int i = 0; i < partVals.size(); i++) {
>       key += partVals.get(i);
>       if (i != partVals.size() - 1) {
>         key += delimit;
>       }
>     }
>     return key;
>   }
> public static Object[] splitPartitionColStats(String key) {
> // ...
> }
> {code}
> The result of passing the key to the "split" method is:
> {code}
> buildKey("db","Table",["Part1","Part2","Part3"], "col");
> [db, tablePart1, [Part2, Part3], col]
> // "table" and "Part1" is mistakenly concatenated
> {code}



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