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


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/PartitionUtils.java:
##########
@@ -108,11 +122,17 @@ public static Partition getPartition(Hive db, Table 
table, Map<String, String> p
   public static List<Partition> getPartitions(Hive db, Table table, 
Map<String, String> partitionSpec,
       boolean throwException) throws SemanticException {
     List<Partition> partitions;
-    try {
-      partitions = partitionSpec == null ? db.getPartitions(table) : 
db.getPartitions(table, partitionSpec);
-    } catch (Exception e) {
-      throw new SemanticException(toMessage(ErrorMsg.INVALID_PARTITION, 
partitionSpec), e);
-    }
+      if (table.getStorageHandler() != null && 
table.getStorageHandler().alwaysUnpartitioned()) {
+        partitions = new ArrayList<>();
+        partitions.add(getPartition(db, table, partitionSpec, throwException));

Review Comment:
   Yes, it is used in case of compactions.
   It is called from AlterTableCompactOperation.
   It is used to parallelize compaction of partitioned table - when partition 
spec is not provided it creates one compaction request per partition. For now 
it is not done for Iceberg, but will be useful in next PRs in which we will 
implement it for Iceberg too.



##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -2127,4 +2127,26 @@ public List<FileStatus> 
getMergeTaskInputFiles(Properties properties) throws IOE
   public MergeTaskProperties getMergeTaskProperties(Properties properties) {
     return new IcebergMergeTaskProperties(properties);
   }
+
+  @Override
+  public boolean 
isIdentityPartitionSpec(org.apache.hadoop.hive.metastore.api.Table table,

Review Comment:
   Done



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