You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2013/03/31 05:30:34 UTC

svn commit: r1462872 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java

Author: hashutosh
Date: Sun Mar 31 03:30:33 2013
New Revision: 1462872

URL: http://svn.apache.org/r1462872
Log:
HIVE-4170 : [REGRESSION] FsShell.close closes filesystem, removing temporary directories (Navis via Ashutosh Chauhan)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java?rev=1462872&r1=1462871&r2=1462872&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java Sun Mar 31 03:30:33 2013
@@ -3955,20 +3955,15 @@ public class DDLTask extends Task<DDLWor
 
     Table table = db.getTable(tableName, true);
 
-    FsShell fshell = new FsShell(conf);
     try {
+      // this is not transactional
       for (Path location : getLocations(db, table, partSpec)) {
-        fshell.run(new String[]{"-rmr", location.toString()});
-        location.getFileSystem(conf).mkdirs(location);
+        FileSystem fs = location.getFileSystem(conf);
+        fs.delete(location, true);
+        fs.mkdirs(location);
       }
     } catch (Exception e) {
       throw new HiveException(e);
-    } finally {
-      try {
-        fshell.close();
-      } catch (IOException e) {
-        // ignore
-      }
     }
     return 0;
   }