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


##########
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:
   `rewritePolicy = ALL_PARTITIONS` is added in case of full table compaction 
for partitioned and unpartitioned tables.
   
   `HiveConf.setVar(conf, HiveConf.ConfVars.REWRITE_POLICY, 
Context.RewritePolicy.PARTITION.name());`
   Is added for partition compaction case only. This code branch is reachable 
only when `partitionSpecNode != null` and `command.getType() == 
HiveParser.TOK_ALTERTABLE_COMPACT`



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