hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ekoif...@apache.org
Subject hive git commit: HIVE-14297 OrcRecordUpdater floods logs trying to create _orc_acid_version file (Eugene Koifman, reviewed by Owen O'Malley)
Date Mon, 25 Jul 2016 17:29:03 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-2.1 0ac914ef0 -> 08709283c


HIVE-14297 OrcRecordUpdater floods logs trying to create _orc_acid_version file (Eugene Koifman,
reviewed by Owen O'Malley)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/08709283
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/08709283
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/08709283

Branch: refs/heads/branch-2.1
Commit: 08709283cce93b068d12b355ab85863ca7624fcf
Parents: 0ac914e
Author: Eugene Koifman <ekoifman@hortonworks.com>
Authored: Mon Jul 25 10:28:57 2016 -0700
Committer: Eugene Koifman <ekoifman@hortonworks.com>
Committed: Mon Jul 25 10:28:57 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hive/ql/io/orc/OrcRecordUpdater.java      | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/08709283/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java
index e577961..1a1af28 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java
@@ -187,14 +187,15 @@ public class OrcRecordUpdater implements RecordUpdater {
       fs = path.getFileSystem(options.getConfiguration());
     }
     this.fs = fs;
-    try {
-      FSDataOutputStream strm = fs.create(new Path(path, ACID_FORMAT), false);
-      strm.writeInt(ORC_ACID_VERSION);
-      strm.close();
-    } catch (IOException ioe) {
-      if (LOG.isDebugEnabled()) {
-        LOG.debug("Failed to create " + path + "/" + ACID_FORMAT + " with " +
+    Path formatFile = new Path(path, ACID_FORMAT);
+    if(!fs.exists(formatFile)) {
+      try (FSDataOutputStream strm = fs.create(formatFile, false)) {
+        strm.writeInt(ORC_ACID_VERSION);
+      } catch (IOException ioe) {
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("Failed to create " + path + "/" + ACID_FORMAT + " with " +
             ioe);
+        }
       }
     }
     if (options.getMinimumTransactionId() != options.getMaximumTransactionId()


Mime
View raw message