deniskuzZ commented on code in PR #5123: URL: https://github.com/apache/hive/pull/5123#discussion_r1525198364
########## iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergOutputCommitter.java: ########## @@ -544,14 +549,20 @@ private void commitWrite(Table table, String branchName, Long snapshotId, long s * @param rewritePolicy The rewrite policy to use for the insert overwrite commit */ private void commitOverwrite(Table table, String branchName, long startTime, FilesForCommit results, - RewritePolicy rewritePolicy) { + RewritePolicy rewritePolicy, String partitionSpec) { Preconditions.checkArgument(results.deleteFiles().isEmpty(), "Can not handle deletes with overwrite"); if (!results.dataFiles().isEmpty()) { Transaction transaction = table.newTransaction(); if (rewritePolicy == RewritePolicy.ALL_PARTITIONS) { DeleteFiles delete = transaction.newDelete(); delete.deleteFromRowFilter(Expressions.alwaysTrue()); delete.commit(); + } else if (rewritePolicy == RewritePolicy.SINGLE_PARTITION) { + try { + HiveIcebergMetaHook.preTruncateTable(table, Arrays.asList(partitionSpec), transaction.newDelete()); Review Comment: should we rename to `truncatePartitionBySpec`? -- 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