wecharyu commented on code in PR #5246:
URL: https://github.com/apache/hive/pull/5246#discussion_r1600913775


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -5563,26 +5563,21 @@ public List<Partition> get_partitions_with_auth(final 
String dbName,
   private void checkLimitNumberOfPartitionsByFilter(String catName, String 
dbName,
                                                     String tblName, String 
filterString,
                                                     int maxParts) throws 
TException {
-    if (isPartitionLimitEnabled()) {
+    if (needCheckPartitionLimit(maxParts)) {

Review Comment:
   1. `needCheckPartitionLimit` is used to determine if needs to check liimt.
   let's say that a request size is 100, LIMIT is 50, then the returned 
partition size may hit limit, so we need check limit;
   Another request size is 30, LIMIT is 50, then returned partition size is 
never greater than limit, so we do not need check limit.
   Let's rename it to `exceedsPartitionLimit(int size)` to reuse it.
   2. The existing behavior is throw exception when hit partition limit, I 
think it's reasonable because returning the limit size partitions is confused 
whether there are other partitions matching my condition and it maybe not the 
expected result to users.



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