diff --git ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java index 3c508ec6cf..dde8878769 100644 --- ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java +++ ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java @@ -1376,11 +1376,11 @@ else if (prev != null && next.maxWriteId == prev.maxWriteId Path parentDirPath = fPath.getParent(); if (acidTempDirFilter.accept(parentDirPath)) { HdfsDirSnapshot dirSnapshot = dirToSnapshots.get(parentDirPath); - FileStatus parentDirFStatus = null; - if (!parentDirPath.equals(path)) { - parentDirFStatus = fs.getFileStatus(parentDirPath); - } if (dirSnapshot == null) { + FileStatus parentDirFStatus = null; + if (!parentDirPath.equals(path)) { + parentDirFStatus = fs.getFileStatus(parentDirPath); + } dirSnapshot = new HdfsDirSnapshotImpl(parentDirPath, parentDirFStatus); dirToSnapshots.put(parentDirPath, dirSnapshot); } diff --git ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java index 9d6fd35bbe..e9f0b98157 100644 --- ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java +++ ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java @@ -3686,7 +3686,7 @@ public void testACIDReaderNoFooterSerializeWithDeltas() throws Exception { readOpsDelta = statistics.getReadOps() - readOpsBefore; } } - assertEquals(7, readOpsDelta); + assertEquals(6, readOpsDelta); // revert back to local fs conf.set("fs.defaultFS", "file:///"); @@ -3760,7 +3760,7 @@ public void testACIDReaderFooterSerializeWithDeltas() throws Exception { readOpsDelta = statistics.getReadOps() - readOpsBefore; } } - assertEquals(7, readOpsDelta); + assertEquals(6, readOpsDelta); // revert back to local fs conf.set("fs.defaultFS", "file:///");