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


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -7223,13 +7214,23 @@ private List<Partition> 
get_partitions_by_filter_internal(final String catName,
     fireReadTablePreEvent(catName, dbName, tblName);
     List<Partition> ret = null;
     Exception ex = null;
+    RawStore rs = getMS();
     try {
-      checkLimitNumberOfPartitionsByFilter(catName, dbName,
-          tblName, args.getFilter(), args.getMax());
-
       authorizeTableForPartitionMetadata(catName, dbName, tblName);
+      if (isPartitionLimitEnabled()) {
+        // Since partition limit is configured, we need fetch at most (limit + 
1) partition names
+        int partitionLimit = MetastoreConf.getIntVar(conf, 
ConfVars.LIMIT_PARTITION_REQUEST);
+        int requestMax = args.getMax();
+        int max = requestMax < 0 ? partitionLimit + 1 : Math.min(requestMax, 
partitionLimit + 1);

Review Comment:
   This logic can also be used in other list partitions api, and now it 
actually causes a bug, create a follow-up ticket 
[HIVE-28239](https://issues.apache.org/jira/browse/HIVE-28239). 



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