pvary commented on a change in pull request #854: HIVE-22537: getAcidState()
not saving directory causes multiple files…
URL: https://github.com/apache/hive/pull/854#discussion_r350606330
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
##########
@@ -1683,15 +1705,20 @@ else if (writeIdList.isWriteIdRangeValid(
}
}
- private static void getChildState(Path candidateDirectory,
List<HdfsDirSnapshot> dirSnapshots, ValidWriteIdList writeIdList,
+ private static void getChildState(Path candidateDirectory, Map<Path,
HdfsDirSnapshot> dirSnapshots, ValidWriteIdList writeIdList,
List<ParsedDelta> working, List<Path> originalDirectories,
List<HdfsFileStatusWithId> original,
List<Path> obsolete, TxnBase bestBase, boolean ignoreEmptyFiles,
List<Path> aborted,
Map<String, String> tblproperties, FileSystem fs, ValidTxnList
validTxnList) throws IOException {
- for (HdfsDirSnapshot dirSnapshot : dirSnapshots) {
+ for (HdfsDirSnapshot dirSnapshot : dirSnapshots.values()) {
FileStatus fStat = dirSnapshot.getFileStatus();
Path dirPath = dirSnapshot.getPath();
String dirName = dirPath.getName();
- if (dirName.startsWith(BASE_PREFIX)) {
+ if (dirPath.equals(candidateDirectory)) {
+ for (FileStatus fileStatus: dirSnapshot.getFiles())
+ if (!ignoreEmptyFiles || fileStatus.getLen() != 0) {
Review comment:
Nit: formatting - please use {} for for loops, like
for () {
if {}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]