hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prasan...@apache.org
Subject svn commit: r1631558 - /hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/OrcFileMergeOperator.java
Date Mon, 13 Oct 2014 21:25:34 GMT
Author: prasanthj
Date: Mon Oct 13 21:25:34 2014
New Revision: 1631558

URL: http://svn.apache.org/r1631558
Log:
HIVE-8401: OrcFileMergeOperator only close last orc file it opened, which resulted in stale
data in table directory (Xiaobing Zhou reviewed by Prasanth J)

Modified:
    hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/OrcFileMergeOperator.java

Modified: hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/OrcFileMergeOperator.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/OrcFileMergeOperator.java?rev=1631558&r1=1631557&r2=1631558&view=diff
==============================================================================
--- hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/OrcFileMergeOperator.java
(original)
+++ hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/OrcFileMergeOperator.java
Mon Oct 13 21:25:34 2014
@@ -64,6 +64,7 @@ public class OrcFileMergeOperator extend
 
   private void processKeyValuePairs(Object key, Object value)
       throws HiveException {
+    String filePath = "";
     try {
       OrcFileValueWrapper v;
       OrcFileKeyWrapper k;
@@ -72,6 +73,7 @@ public class OrcFileMergeOperator extend
       } else {
         k = (OrcFileKeyWrapper) key;
       }
+      filePath = k.getInputPath().toUri().getPath();
 
       fixTmpPath(k.getInputPath().getParent());
 
@@ -131,6 +133,16 @@ public class OrcFileMergeOperator extend
       this.exception = true;
       closeOp(true);
       throw new HiveException(e);
+    } finally {
+      if (fdis != null) {
+        try {
+          fdis.close();
+        } catch (IOException e) {
+          throw new HiveException(String.format("Unable to close file %s", filePath), e);
+        } finally {
+          fdis = null;
+        }
+      }
     }
   }
 



Mime
View raw message