hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1418863 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java test/queries/clientpositive/repair.q test/queries/clientpositive/repair_hadoop23.q
Date Sun, 09 Dec 2012 09:40:39 GMT
Author: hashutosh
Date: Sun Dec  9 09:40:38 2012
New Revision: 1418863

URL: http://svn.apache.org/viewvc?rev=1418863&view=rev
Log:
HIVE-3231 : msck repair should find partitions already containing data files (Keegan Mosley
via Ashutosh Chauhan)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java
    hive/trunk/ql/src/test/queries/clientpositive/repair.q
    hive/trunk/ql/src/test/queries/clientpositive/repair_hadoop23.q

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java?rev=1418863&r1=1418862&r2=1418863&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java Sun
Dec  9 09:40:38 2012
@@ -363,16 +363,18 @@ public class HiveMetaStoreChecker {
       throws IOException {
 
     FileStatus[] statuses = fs.listStatus(basePath);
-
-    if (statuses.length == 0) {
-      allDirs.add(basePath);
-    }
+    boolean directoryFound=false;
 
     for (FileStatus status : statuses) {
       if (status.isDir()) {
+        directoryFound = true;
         getAllLeafDirs(status.getPath(), allDirs, fs);
       }
     }
+
+    if(!directoryFound){
+      allDirs.add(basePath);
+    }
   }
 
 }

Modified: hive/trunk/ql/src/test/queries/clientpositive/repair.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/repair.q?rev=1418863&r1=1418862&r2=1418863&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/repair.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/repair.q Sun Dec  9 09:40:38 2012
@@ -19,6 +19,7 @@ MSCK TABLE repairtable;
 
 dfs -mkdir -p ../build/ql/test/data/warehouse/repairtable/p1=a/p2=a;
 dfs -mkdir -p ../build/ql/test/data/warehouse/repairtable/p1=b/p2=a;
+dfs -touchz ../build/ql/test/data/warehouse/repairtable/p1=b/p2=a/datafile;
 
 MSCK TABLE repairtable;
 

Modified: hive/trunk/ql/src/test/queries/clientpositive/repair_hadoop23.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/repair_hadoop23.q?rev=1418863&r1=1418862&r2=1418863&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/repair_hadoop23.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/repair_hadoop23.q Sun Dec  9 09:40:38 2012
@@ -18,6 +18,7 @@ MSCK TABLE repairtable;
 
 dfs -mkdir ../build/ql/test/data/warehouse/repairtable/p1=a/p2=a;
 dfs -mkdir ../build/ql/test/data/warehouse/repairtable/p1=b/p2=a;
+dfs -touchz ../build/ql/test/data/warehouse/repairtable/p1=b/p2=a/datafile;
 
 MSCK TABLE repairtable;
 



Mime
View raw message