Author: brock
Date: Wed Jan  7 22:52:23 2015
New Revision: 1650190

URL: http://svn.apache.org/r1650190
Log:
HIVE-9285 - The move task doesn't work for inserting overwrite a local 
directory in test mode (Ferdinand Xu vi Brock)

Modified:
    
hive/branches/HIVE-8065/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java

Modified: 
hive/branches/HIVE-8065/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
URL: 
http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java?rev=1650190&r1=1650189&r2=1650190&view=diff
==============================================================================
--- 
hive/branches/HIVE-8065/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
 (original)
+++ 
hive/branches/HIVE-8065/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
 Wed Jan  7 22:52:23 2015
@@ -2364,11 +2364,17 @@ private void constructOneLBLocationMap(F
       return false;
     }
     URI srcfUri = srcf.toUri();
-    // If the source file is in the file schema, it can not be the 
subdirectory of a HDFS path
-    if (srcfUri != null && srcfUri.isAbsolute() && 
!srcfUri.getScheme().equals("hdfs")) {
-      return false;
-    } else {
+    // In query test, the ware house is using the local file system.
+    boolean isInTest = Boolean.valueOf(HiveConf.getBoolVar(fs.getConf(), 
ConfVars.HIVE_IN_TEST));
+    if (isInTest) {
       return FileUtils.isSubDir(srcf, destf, fs);
+    } else {
+      // If the source file is in the file schema, it can not be the 
subdirectory of a HDFS path
+      if (srcfUri != null && srcfUri.isAbsolute() && 
!srcfUri.getScheme().equals("hdfs")) {
+        return false;
+      } else {
+        return FileUtils.isSubDir(srcf, destf, fs);
+      }
     }
   }
 


Reply via email to