You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by da...@apache.org on 2017/05/12 18:31:55 UTC

hive git commit: HIVE-16586: Fix Unit test failures when CachedStore is enabled (Daniel Dai, reviewed by Thejas Nair)

Repository: hive
Updated Branches:
  refs/heads/master dd2697c00 -> 8a7b5b565


HIVE-16586: Fix Unit test failures when CachedStore is enabled (Daniel Dai, reviewed by Thejas Nair)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/8a7b5b56
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/8a7b5b56
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/8a7b5b56

Branch: refs/heads/master
Commit: 8a7b5b565ad1c719afcd565c41523ef0bd1edbfb
Parents: dd2697c
Author: Daniel Dai <da...@hortonworks.com>
Authored: Fri May 12 11:31:42 2017 -0700
Committer: Daniel Dai <da...@hortonworks.com>
Committed: Fri May 12 11:31:42 2017 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/metastore/cache/CacheUtils.java  | 2 +-
 .../org/apache/hadoop/hive/metastore/cache/CachedStore.java | 9 ++++++---
 .../org/apache/hadoop/hive/metastore/hbase/HBaseUtils.java  | 3 ++-
 3 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/8a7b5b56/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CacheUtils.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CacheUtils.java b/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CacheUtils.java
index b438479..668499b 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CacheUtils.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CacheUtils.java
@@ -103,7 +103,7 @@ public class CacheUtils {
     String[] subpatterns = pattern.trim().split("\\|");
     for (String subpattern : subpatterns) {
       subpattern = "(?i)" + subpattern.replaceAll("\\?", ".{1}").replaceAll("\\*", ".*")
-          .replaceAll("\\^", "\\\\^").replaceAll("\\$", "\\\\$");;
+          .replaceAll("\\^", "\\\\^").replaceAll("\\$", "\\\\$");
       if (Pattern.matches(subpattern, HiveStringUtils.normalizeIdentifier(name))) {
         return true;
       }

http://git-wip-us.apache.org/repos/asf/hive/blob/8a7b5b56/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java
index a04fd5b..5a187d8 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java
@@ -514,8 +514,8 @@ public class CachedStore implements RawStore, Configurable {
     if (succ) {
       interruptCacheUpdateMaster();
       for (Partition part : parts) {
-        SharedCache.addPartitionToCache(HiveStringUtils.normalizeIdentifier(dbName),
-            HiveStringUtils.normalizeIdentifier(tblName), part);
+        SharedCache.addPartitionToCache(HiveStringUtils.normalizeIdentifier(part.getDbName()),
+            HiveStringUtils.normalizeIdentifier(part.getTableName()), part);
       }
     }
     return succ;
@@ -545,6 +545,8 @@ public class CachedStore implements RawStore, Configurable {
         HiveStringUtils.normalizeIdentifier(tableName), part_vals);
     if (part != null) {
       part.unsetPrivileges();
+    } else {
+      throw new NoSuchObjectException();
     }
     return part;
   }
@@ -782,6 +784,7 @@ public class CachedStore implements RawStore, Configurable {
     for (String partName : partNames) {
       Partition part = SharedCache.getPartitionFromCache(HiveStringUtils.normalizeIdentifier(dbName),
           HiveStringUtils.normalizeIdentifier(tblName), partNameToVals(partName));
+      part.unsetPrivileges();
       result.add(part);
     }
     return hasUnknownPartitions;
@@ -1046,7 +1049,7 @@ public class CachedStore implements RawStore, Configurable {
         }
       }
       if (!psMatch) {
-        break;
+        continue;
       }
       if (maxParts == -1 || count < maxParts) {
         partNames.add(Warehouse.makePartName(t.getPartitionKeys(), part.getValues()));

http://git-wip-us.apache.org/repos/asf/hive/blob/8a7b5b56/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseUtils.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseUtils.java b/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseUtils.java
index 3172f92..7dfa38f 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseUtils.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseUtils.java
@@ -653,7 +653,7 @@ public class HBaseUtils {
       }
     }
     if (sd.getBucketCols() != null) {
-      SortedSet<String> bucketCols = new TreeSet<>(sd.getBucketCols());
+      List<String> bucketCols = new ArrayList<>(sd.getBucketCols());
       for (String bucket : bucketCols) md.update(bucket.getBytes(ENCODING));
     }
     if (sd.getSortCols() != null) {
@@ -688,6 +688,7 @@ public class HBaseUtils {
           md.update(e.getValue().getBytes(ENCODING));
         }
       }
+      md.update(sd.isStoredAsSubDirectories() ? "true".getBytes(ENCODING) : "false".getBytes(ENCODING));
     }
 
     return md.digest();