dengzhhu653 commented on code in PR #6886:
URL: https://github.com/apache/hive/pull/6886#discussion_r4310071102


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -1577,9 +1577,14 @@ public GetPartitionsResponse 
get_partitions_with_specs(GetPartitionsRequest requ
       getTableRequest.setCatName(catName);
       Table table = get_table_core(getTableRequest);
       firePreEvent(new PreReadTableEvent(table, this));
+      // Fail fast before the expensive fetch; the check on the fetched result 
below
+      // remains as the final backstop
+      GetPartitionsHandler.checkLimitNumberOfPartitionsByFilterSpec(getConf(), 
getMS(), catName,
+          parsedDbName[DB_NAME], tableName, request.getFilterSpec());
       List<Partition> partitions = getMS()
           .getPartitionSpecsByFilterAndProjection(table, 
request.getProjectionSpec(),
               request.getFilterSpec());
+      GetPartitionsHandler.checkLimitNumberOfPartitions(getConf(), tableName, 
partitions.size());

Review Comment:
   Can you move this implementation to GetPartitionsHandler if it's ok? so it 
shares the same pre check and post check and the fetch limit validation.



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