hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pxi...@apache.org
Subject hive git commit: HIVE-14924: MSCK REPAIR table with single threaded is throwing null pointer exception (Pengcheng Xiong, reviewed by Ashutosh Chauhan)
Date Tue, 08 Nov 2016 07:14:15 GMT
Repository: hive
Updated Branches:
  refs/heads/master 45b2f9515 -> 36ea6831f


HIVE-14924: MSCK REPAIR table with single threaded is throwing null pointer exception (Pengcheng
Xiong, reviewed by Ashutosh Chauhan)


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

Branch: refs/heads/master
Commit: 36ea6831f480173befaf28138aa9bf19f8366010
Parents: 45b2f95
Author: Pengcheng Xiong <pxiong@apache.org>
Authored: Mon Nov 7 23:13:51 2016 -0800
Committer: Pengcheng Xiong <pxiong@apache.org>
Committed: Mon Nov 7 23:13:51 2016 -0800

----------------------------------------------------------------------
 .../hive/ql/metadata/HiveMetaStoreChecker.java  |  4 +-
 .../test/queries/clientpositive/msck_repair_0.q | 19 ++++++++++
 .../results/clientpositive/msck_repair_0.q.out  | 39 ++++++++++++++++++++
 3 files changed, 61 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/36ea6831/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java
index 047589a..57f731f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java
@@ -420,7 +420,9 @@ public class HiveMetaStoreChecker {
           + ((ThreadPoolExecutor) pool).getPoolSize());
     }
     checkPartitionDirs(pool, basePaths, dirSet, basePath.getFileSystem(conf), maxDepth, maxDepth);
-    pool.shutdown();
+    if (pool != null) {
+      pool.shutdown();
+    }
     allDirs.addAll(dirSet);
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/36ea6831/ql/src/test/queries/clientpositive/msck_repair_0.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/msck_repair_0.q b/ql/src/test/queries/clientpositive/msck_repair_0.q
new file mode 100644
index 0000000..ce8ef42
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/msck_repair_0.q
@@ -0,0 +1,19 @@
+set hive.msck.repair.batch.size=1;
+set hive.mv.files.thread=0;
+
+DROP TABLE IF EXISTS repairtable;
+
+CREATE TABLE repairtable(col STRING) PARTITIONED BY (p1 STRING, p2 STRING);
+
+MSCK TABLE repairtable;
+
+dfs ${system:test.dfs.mkdir} ${system:test.warehouse.dir}/repairtable/p1=c/p2=a/p3=b;
+dfs -touchz ${system:test.warehouse.dir}/repairtable/p1=c/p2=a/p3=b/datafile;
+
+MSCK TABLE default.repairtable;
+
+MSCK REPAIR TABLE default.repairtable;
+
+MSCK TABLE repairtable;
+
+DROP TABLE default.repairtable;

http://git-wip-us.apache.org/repos/asf/hive/blob/36ea6831/ql/src/test/results/clientpositive/msck_repair_0.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/msck_repair_0.q.out b/ql/src/test/results/clientpositive/msck_repair_0.q.out
new file mode 100644
index 0000000..c394f9b
--- /dev/null
+++ b/ql/src/test/results/clientpositive/msck_repair_0.q.out
@@ -0,0 +1,39 @@
+PREHOOK: query: DROP TABLE IF EXISTS repairtable
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: DROP TABLE IF EXISTS repairtable
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: CREATE TABLE repairtable(col STRING) PARTITIONED BY (p1 STRING, p2 STRING)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@repairtable
+POSTHOOK: query: CREATE TABLE repairtable(col STRING) PARTITIONED BY (p1 STRING, p2 STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@repairtable
+PREHOOK: query: MSCK TABLE repairtable
+PREHOOK: type: MSCK
+POSTHOOK: query: MSCK TABLE repairtable
+POSTHOOK: type: MSCK
+PREHOOK: query: MSCK TABLE default.repairtable
+PREHOOK: type: MSCK
+POSTHOOK: query: MSCK TABLE default.repairtable
+POSTHOOK: type: MSCK
+Partitions not in metastore:	repairtable:p1=c/p2=a
+PREHOOK: query: MSCK REPAIR TABLE default.repairtable
+PREHOOK: type: MSCK
+POSTHOOK: query: MSCK REPAIR TABLE default.repairtable
+POSTHOOK: type: MSCK
+Partitions not in metastore:	repairtable:p1=c/p2=a
+Repair: Added partition to metastore default.repairtable:p1=c/p2=a
+PREHOOK: query: MSCK TABLE repairtable
+PREHOOK: type: MSCK
+POSTHOOK: query: MSCK TABLE repairtable
+POSTHOOK: type: MSCK
+PREHOOK: query: DROP TABLE default.repairtable
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@repairtable
+PREHOOK: Output: default@repairtable
+POSTHOOK: query: DROP TABLE default.repairtable
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@repairtable
+POSTHOOK: Output: default@repairtable


Mime
View raw message