deniskuzZ commented on code in PR #5910:
URL: https://github.com/apache/hive/pull/5910#discussion_r2174520359
##########
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:
after the code move, you can simply pass `partitionsToAdd`
--
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]