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


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/compact/AlterTableCompactOperation.java:
##########
@@ -133,7 +140,7 @@ private List<Partition> getPartitions(Table table, 
AlterTableCompactDesc desc, D
       }
     } else {
       Map<String, String> partitionSpec = desc.getPartitionSpec();
-      partitions = context.getDb().getPartitions(table, partitionSpec);
+      partitions.addAll(PartitionUtils.getPartitions(context.getDb(), table, 
partitionSpec, false));

Review Comment:
   This is existing functionality which I didn't change.
   I think it calls getPartitions on purpose to validate that only one 
partition is retrieved with the provided spec.
   On the next lines it checks that only 1 partition was found for the 
partition spec and throws an exception otherwise.
   ```
         if (partitions.size() > 1) {
           throw new HiveException(ErrorMsg.TOO_MANY_COMPACTION_PARTITIONS);
         } else if (partitions.isEmpty()) {
           throw new HiveException(ErrorMsg.INVALID_PARTITION_SPEC);
         }
   ```



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