commit c24a4eddd091c4d512be73aaabe343e50d2ee596 Author: Mithun RK Date: Fri Oct 13 14:21:39 2017 -0700 HIVE-17803: With Pig multi-query, 2 HCatStorers writing to the same table will trample each other's outputs (Chris Drome, reviewed by Mithun Radhakrishnan) diff --git a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/FileOutputCommitterContainer.java b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/FileOutputCommitterContainer.java index f787d4f2a5..04d78eed05 100644 --- a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/FileOutputCommitterContainer.java +++ b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/FileOutputCommitterContainer.java @@ -582,9 +582,9 @@ private void moveTaskOutputs(FileSystem fs, Path file, Path srcDir, final Path parentDir = finalOutputPath.getParent(); // Create the directory - Path placeholder = new Path(parentDir, "_placeholder"); + Path placeholder = new Path(parentDir, "_placeholder" + String.valueOf(Math.random())); if (fs.mkdirs(parentDir)) { - // It is weired but we need a placeholder, + // It is weird but we need a placeholder, // otherwise rename cannot move file to the right place fs.create(placeholder).close(); }