SourabhBadhya commented on code in PR #5076: URL: https://github.com/apache/hive/pull/5076#discussion_r1505587079
########## iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergOutputCommitter.java: ########## @@ -163,6 +167,26 @@ public void commitTask(TaskAttemptContext originalContext) throws IOException { LOG.info("CommitTask found no serialized table in config for table: {}.", output); } }, IOException.class); + + // Merge task has merged several files into one. Hence we need to remove the stale files. + // At this stage the file is written and task-committed, but the old files are still present. + if (CombineHiveInputFormat.class.equals(jobConf.getInputFormat().getClass())) { + MapWork mrwork = Utilities.getMapWork(jobConf); + if (mrwork != null) { + List<Path> mergedPaths = mrwork.getInputPaths(); + if (CollectionUtils.isNotEmpty(mergedPaths)) { + Tasks.foreach(mergedPaths) Review Comment: Removed empty collection check & replaced with null check which is necessary. Done. -- 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