commit c307cbc6d69c0775498b7f42f7f42408fb471513 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 e90385d539..614c29bb15 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 @@ -3350,7 +3350,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); } }