You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pr...@apache.org on 2014/10/13 23:25:34 UTC
svn commit: r1631558 -
/hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/OrcFileMergeOperator.java
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;
+ }
+ }
}
}