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


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -5563,43 +5563,35 @@ 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 (exceedsPartitionLimit(maxParts)) {
       checkLimitNumberOfPartitions(tblName, 
get_num_partitions_by_filter(prependCatalogToDbName(
-          catName, dbName, conf), tblName, filterString), maxParts);
+          catName, dbName, conf), tblName, filterString));
     }
   }
 
   private void checkLimitNumberOfPartitionsByPs(String catName, String dbName, 
String tblName,
                                                 List<String> partVals, int 
maxParts)
           throws TException {
-    if (isPartitionLimitEnabled()) {
+    if (exceedsPartitionLimit(maxParts)) {
       checkLimitNumberOfPartitions(tblName, getNumPartitionsByPs(catName, 
dbName, tblName,
-              partVals), maxParts);
+              partVals));
     }
   }
 
-  private boolean isPartitionLimitEnabled() {
-    int partitionLimit = MetastoreConf.getIntVar(conf, 
ConfVars.LIMIT_PARTITION_REQUEST);
-    return partitionLimit > -1;
-  }
-
-  // Check request partition limit iff:
+  // Check input size exceeding partition limit iff:
   //  1. partition limit is enabled.
-  //  2. request size is greater than the limit.
-  private boolean needCheckPartitionLimit(int requestSize) {
+  //  2. input size is greater than the limit.
+  private boolean exceedsPartitionLimit(int size) {

Review Comment:
   maybe. `exceedsPartitionFetchLimit`



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -5563,43 +5563,35 @@ 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 (exceedsPartitionLimit(maxParts)) {
       checkLimitNumberOfPartitions(tblName, 
get_num_partitions_by_filter(prependCatalogToDbName(
-          catName, dbName, conf), tblName, filterString), maxParts);
+          catName, dbName, conf), tblName, filterString));
     }
   }
 
   private void checkLimitNumberOfPartitionsByPs(String catName, String dbName, 
String tblName,
                                                 List<String> partVals, int 
maxParts)
           throws TException {
-    if (isPartitionLimitEnabled()) {
+    if (exceedsPartitionLimit(maxParts)) {
       checkLimitNumberOfPartitions(tblName, getNumPartitionsByPs(catName, 
dbName, tblName,
-              partVals), maxParts);
+              partVals));
     }
   }
 
-  private boolean isPartitionLimitEnabled() {
-    int partitionLimit = MetastoreConf.getIntVar(conf, 
ConfVars.LIMIT_PARTITION_REQUEST);
-    return partitionLimit > -1;
-  }
-
-  // Check request partition limit iff:
+  // Check input size exceeding partition limit iff:
   //  1. partition limit is enabled.
-  //  2. request size is greater than the limit.
-  private boolean needCheckPartitionLimit(int requestSize) {
+  //  2. input size is greater than the limit.
+  private boolean exceedsPartitionLimit(int size) {

Review Comment:
   maybe `exceedsPartitionFetchLimit`



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