SourabhBadhya commented on code in PR #4520: URL: https://github.com/apache/hive/pull/4520#discussion_r1304517570
########## ql/src/java/org/apache/hadoop/hive/ql/plan/ConditionalResolverMergeFiles.java: ########## @@ -419,17 +454,79 @@ private AverageSize getAverageSize(FileSystem inpFs, Path dirPath) { */ private long getMergeSize(FileSystem inpFs, Path dirPath, long avgSize) { AverageSize averageSize = getAverageSize(inpFs, dirPath); - if (averageSize.getTotalSize() < 0) { + return getMergeSize(averageSize.totalSize, averageSize.numFiles, avgSize); + } + + private List<FileStatus> getManifestFilePaths(HiveConf conf, Path dirPath) throws IOException { + FileSystem manifestFs = dirPath.getFileSystem(conf); + List<String> filesKept; + List<FileStatus> pathsKept = new ArrayList<>(); + try (FSDataInputStream inStream = manifestFs.open(new Path(dirPath, Utilities.BLOB_MANIFEST_FILE))) { + String paths = IOUtils.toString(inStream, Charset.defaultCharset()); + filesKept = new ArrayList(Arrays.asList(paths.split(System.lineSeparator()))); Review Comment: To make the list mutable. We need to perform a remove operation to remove the tbl directory. -- 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. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org