difin commented on code in PR #5248:
URL: https://github.com/apache/hive/pull/5248#discussion_r1640370354
##########
ql/src/java/org/apache/hadoop/hive/ql/Context.java:
##########
@@ -256,7 +256,8 @@ public String toString() {
public enum RewritePolicy {
DEFAULT,
- ALL_PARTITIONS;
+ ALL_PARTITIONS,
+ PARTITION;
Review Comment:
We can manage without 'PARTITION' rewrite policy, but to me it is confusing
why we have the value 'ALL_PARTITIONS' for compacting all partitions, but there
is no policy when compacting one partition only and it seems to be unclear to
others too based on this comment
https://github.com/apache/hive/pull/5248#discussion_r1621812294.
Addition of 'PARTITION' rewrite policy also simplifies code in a few places
because now it is possible to check only REWRITE_POLICY instead of verifying
other configs like in the following example:
This was in `HiveIcebergStorageHandler.validateSinkDesc` method previously:
```
if (RewritePolicy.fromString(conf.get(ConfVars.REWRITE_POLICY.varname,
RewritePolicy.DEFAULT.name())) ==
RewritePolicy.ALL_PARTITIONS ||
conf.get(CompactorContext.COMPACTION_PART_SPEC_ID) != null) {
// Table rewriting has special logic as part of IOW that handles the
case when table had a partition evolution
return;
}
```
And now:
```
if
(RewritePolicy.fromString(conf.get(ConfVars.REWRITE_POLICY.varname)) !=
RewritePolicy.DEFAULT) {
// Table rewriting has special logic as part of IOW that handles the
case when table had a partition evolution
return;
}
```
--
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]