deniskuzZ commented on code in PR #4855:
URL: https://github.com/apache/hive/pull/4855#discussion_r1402658205


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergOutputCommitter.java:
##########
@@ -469,12 +474,34 @@ private Long getSnapshotId(Table table, String 
branchName) {
   /**
    * Creates and commits an Iceberg change with the provided data and delete 
files.
    * If there are no delete files then an Iceberg 'append' is created, 
otherwise Iceberg 'overwrite' is created.
-   * @param table The table we are changing
-   * @param startTime The start time of the commit - used only for logging
-   * @param results The object containing the new files we would like to add 
to the table
+   *
+   * @param table        The table we are changing
+   * @param startTime    The start time of the commit - used only for logging
+   * @param results      The object containing the new files we would like to 
add to the table
+   * @param isCompaction Flag that indicates whether or not the operation is 
done as part of compaction
    */
   private void commitWrite(Table table, String branchName, Long snapshotId, 
long startTime,
-      FilesForCommit results, Operation operation) {
+                           FilesForCommit results, Operation operation, 
boolean isCompaction) {
+
+    if (isCompaction) {

Review Comment:
   ````
   public class Context {
       ...
       RewriteDataPolicy rewritePolicy = RewriteDataPolicy.DEFAULT;
       ...
       RewriteDataPolicy {DEFAULT, ALL_PARTITIONS}
   }
   ````
   
   MoveTask#checkAndCommitNatively
   ````
   if (isCompaction) {
      commitProperties.setProperty("REWRITE_DATA_POLICY", 
Context.RewriteDataPolicy.ALL_PARTITIONS.name());
   }
   ````
   extract `rewritePolicy` in commitOverwrite
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to