Repository: hive
Updated Branches:
  refs/heads/hive-14535 b802d1b13 -> b362437e3


HIVE-16212 : MM tables: suspicious ORC HDFS counter changes (Sergey Shelukhin)


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

Branch: refs/heads/hive-14535
Commit: b362437e36d190ad830a606d3d78cbdcdef02230
Parents: b802d1b
Author: Sergey Shelukhin <[email protected]>
Authored: Tue Mar 14 17:45:38 2017 -0700
Committer: Sergey Shelukhin <[email protected]>
Committed: Tue Mar 14 17:45:38 2017 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/exec/FileSinkOperator.java | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/b362437e/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
index 40ea3a3..3ad1733 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java
@@ -738,7 +738,10 @@ public class FileSinkOperator extends 
TerminalOperator<FileSinkDesc> implements
       if (conf.getWriteType() == AcidUtils.Operation.NOT_ACID ||
           conf.getWriteType() == AcidUtils.Operation.INSERT_ONLY) {
         Path outPath = fsp.outPaths[filesIdx];
-        mkDirIfPermsAreNeeded(outPath); // Make sure we inherit permissions.
+        if ((conf.getWriteType() == AcidUtils.Operation.INSERT_ONLY || 
conf.isMmTable())
+            && inheritPerms && !FileUtils.mkdir(fs, outPath.getParent(), 
inheritPerms, hconf)) {
+          LOG.warn("Unable to create directory with inheritPerms: " + outPath);
+        }
         fsp.outWriters[filesIdx] = HiveFileFormatUtils.getHiveRecordWriter(jc, 
conf.getTableInfo(),
             outputClass, conf, outPath, reporter);
         // If the record writer provides stats, get it from there instead of 
the serde
@@ -763,12 +766,6 @@ public class FileSinkOperator extends 
TerminalOperator<FileSinkDesc> implements
     }
   }
 
-  private void mkDirIfPermsAreNeeded(Path outPath) throws IOException {
-    if (inheritPerms && !FileUtils.mkdir(fs, outPath.getParent(), 
inheritPerms, hconf)) {
-      LOG.warn("Unable to create directory with inheritPerms: " + outPath);
-    }
-  }
-
   /**
    * Report status to JT so that JT won't kill this task if closing takes too 
long
    * due to too many files to close and the NN is overloaded.

Reply via email to