hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ct...@apache.org
Subject hive git commit: HIVE-14457: Partitions in encryption zone are still trashed though an exception is returned (Chaoyu Tang, reviewed by Yongzhi Chen, Sergio Pena)
Date Wed, 10 Aug 2016 14:23:11 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-2.1 bc19ac1b2 -> aca44e2e4


HIVE-14457: Partitions in encryption zone are still trashed though an exception is returned
(Chaoyu Tang, reviewed by Yongzhi Chen, Sergio Pena)


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

Branch: refs/heads/branch-2.1
Commit: aca44e2e4ccd2e79b6042895667b15013761773e
Parents: bc19ac1
Author: ctang <ctang@cloudera.com>
Authored: Wed Aug 10 10:21:48 2016 -0400
Committer: ctang <ctang@cloudera.com>
Committed: Wed Aug 10 10:22:44 2016 -0400

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/metastore/HiveMetaStore.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/aca44e2e/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
index 9e633e5..d2d367a 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -2846,16 +2846,18 @@ public class HiveMetaStore extends ThriftHiveMetastore {
           checkTrashPurgeCombination(archiveParentDir, db_name + "." + tbl_name + "." + part_vals,
               mustPurge, deleteData && !isExternalTbl);
         }
-        if (!ms.dropPartition(db_name, tbl_name, part_vals)) {
-          throw new MetaException("Unable to drop partition");
-        }
-        success = ms.commitTransaction();
+
         if ((part.getSd() != null) && (part.getSd().getLocation() != null)) {
           partPath = new Path(part.getSd().getLocation());
           verifyIsWritablePath(partPath);
           checkTrashPurgeCombination(partPath, db_name + "." + tbl_name + "." + part_vals,
               mustPurge, deleteData && !isExternalTbl);
         }
+
+        if (!ms.dropPartition(db_name, tbl_name, part_vals)) {
+          throw new MetaException("Unable to drop partition");
+        }
+        success = ms.commitTransaction();
       } finally {
         if (!success) {
           ms.rollbackTransaction();


Mime
View raw message