deniskuzZ commented on code in PR #5910:
URL: https://github.com/apache/hive/pull/5910#discussion_r2176576498


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -4319,19 +4320,30 @@ private List<Partition> add_partitions_core(final 
RawStore ms, String catName,
         // incorrect, an exception will be thrown before the threads which 
create the partition
         // folders are submitted. This way we can be sure that no partition 
and no partition
         // folder will be created if the list contains an invalid partition.
-        if (validatePartition(part, catName, tblName, dbName, partsToAdd, ms, 
ifNotExists,
-            partitionKeys)) {
-          partitionsToAdd.add(part);
-        } else {
-          existingParts.add(part);
-        }
+        validatePartition(part, catName, tblName, dbName, partsToAdd);
+        nameToPart.put(Warehouse.makePartName(partitionKeys, 
part.getValues()), part);
       }
 
-      // Only authorize on newly created partitions
-      if (!partitionsToAdd.isEmpty()) {
-        firePreEvent(new PreAddPartitionEvent(tbl, partitionsToAdd, this));
+      List<Partition> existedParts =
+          ms.getPartitionsByNames(catName, dbName, tblName,
+              new GetPartitionsArgs.GetPartitionsArgsBuilder().partNames(new 
ArrayList<>(nameToPart.keySet())).build());

Review Comment:
   oh, i missed that we alter the Map
   ````
   existingParts.add(nameToPart.remove(partName));
   ````



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to