You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by na...@apache.org on 2010/08/17 22:55:51 UTC

svn commit: r986480 - in /hadoop/hive/trunk: CHANGES.txt ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java

Author: namit
Date: Tue Aug 17 20:55:51 2010
New Revision: 986480

URL: http://svn.apache.org/viewvc?rev=986480&view=rev
Log:
HIVE-1547 Unarchiving operation throws NPE
(Paul Yang via namit)


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

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=986480&r1=986479&r2=986480&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Tue Aug 17 20:55:51 2010
@@ -147,6 +147,9 @@ Trunk -  Unreleased
     HIVE-1543 Abort in ExecMapper when record reader's next gets a exception
     (Ning Zhang via namit)
 
+    HIVE-1547 Unarchiving operation throws NPE
+    (He Yongqiang via namit)
+
   TESTS
 
     HIVE-1464. improve  test query performance

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java?rev=986480&r1=986479&r2=986480&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java Tue Aug 17 20:55:51 2010
@@ -726,7 +726,7 @@ public class DDLTask extends Task<DDLWor
       // Verify that there are no files in the tmp dir, because if there are, it
       // would be copied to the partition
       FileStatus [] filesInTmpDir = fs.listStatus(tmpDir);
-      if (filesInTmpDir.length != 0) {
+      if (filesInTmpDir != null && filesInTmpDir.length != 0) {
         for (FileStatus file : filesInTmpDir) {
           console.printInfo(file.getPath().toString());
         }
@@ -1584,7 +1584,7 @@ public class DDLTask extends Task<DDLWor
     // alter the table
     Table tbl = db.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, alterTbl
         .getOldName());
-    
+
     Partition part = null;
     if(alterTbl.getPartSpec() != null) {
       part = db.getPartition(tbl, alterTbl.getPartSpec(), false);
@@ -1777,7 +1777,7 @@ public class DDLTask extends Task<DDLWor
       if (part != null) {
         part.setProtectMode(mode);
       } else {
-        tbl.setProtectMode(mode);        
+        tbl.setProtectMode(mode);
       }
 
     } else if (alterTbl.getOp() == AlterTableDesc.AlterTableTypes.ADDCLUSTERSORTCOLUMN) {
@@ -1857,12 +1857,12 @@ public class DDLTask extends Task<DDLWor
       part.getParameters().put("last_modified_time", Long.toString(System
           .currentTimeMillis() / 1000));
     }
-    
+
     try {
       if (part == null) {
         db.alterTable(alterTbl.getOldName(), tbl);
       } else {
-        db.alterPartition(tbl.getTableName(), part);        
+        db.alterPartition(tbl.getTableName(), part);
       }
     } catch (InvalidOperationException e) {
       console.printError("Invalid alter operation: " + e.getMessage());