commit 5ef7368fe8e82075b9c364b15ab9dd168fb255ba Author: Mithun Radhakrishnan Date: Thu Oct 12 13:46:26 2017 -0700 HIVE-17791: Temp dirs under the staging directory should honour 'inheritPerms' (Chris Drome, reviewed by Mithun Radhakrishnan) diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java index 9569ff49cb..187db445a3 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java @@ -3349,7 +3349,9 @@ private static void createTmpDirs(Configuration conf, if (tempDir != null) { Path tempPath = Utilities.toTempPath(tempDir); FileSystem fs = tempPath.getFileSystem(conf); - fs.mkdirs(tempPath); + // The parent directory of tempPath is created by Context.getStagingDir. + // Make tempPath in the same fashion to avoid inconsistencies. + FileUtils.mkdir(fs, tempPath, true, conf); } }