SourabhBadhya commented on code in PR #5248:
URL: https://github.com/apache/hive/pull/5248#discussion_r1631109872


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/AbstractAlterTableAnalyzer.java:
##########
@@ -55,6 +57,9 @@ public void analyzeInternal(ASTNode root) throws 
SemanticException {
       if (command.getType() == HiveParser.TOK_ALTERTABLE_RENAMEPART) {
         partitionSpec = getPartSpec(partitionSpecNode);
       } else {
+        if (command.getType() == HiveParser.TOK_ALTERTABLE_COMPACT) {
+          HiveConf.setVar(conf, HiveConf.ConfVars.REWRITE_POLICY, 
Context.RewritePolicy.PARTITION.name());

Review Comment:
   Is it applied for partition compaction case or is it added generically to 
all cases?



##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergOutputCommitter.java:
##########
@@ -481,7 +484,23 @@ private void commitTable(FileIO io, ExecutorService 
executor, OutputTable output
           .map(x -> x.getJobConf().get(ConfVars.REWRITE_POLICY.varname))
           .orElse(RewritePolicy.DEFAULT.name()));
 
-      commitOverwrite(table, branchName, startTime, filesForCommit, 
rewritePolicy);
+      Integer compactionPartSpecId = outputTable.jobContexts.stream()
+          .findAny()
+          .map(x -> 
x.getJobConf().get(CompactorContext.COMPACTION_PART_SPEC_ID))
+          .map(Integer::valueOf)
+          .orElse(null);
+
+      String compactionPartitionPath = outputTable.jobContexts.stream()
+          .findAny()
+          .map(x -> 
x.getJobConf().get(CompactorContext.COMPACTION_PARTITION_PATH))
+          .orElse(null);
+
+      if (rewritePolicy != RewritePolicy.DEFAULT || compactionPartSpecId != 
null) {

Review Comment:
   So is the value of rewritePolicy = ALL_PARTITIONS in the case of table level 
compaction on a fully partitioned table and rewritePolicy = PARTITION in the 
case of partition level compaction?



-- 
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