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


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -7350,6 +7346,25 @@ public PartitionsByExprResult get_partitions_by_expr(
     return ret;
   }
 
+  private PartitionsByExprResult get_partitions_by_expr_internal(
+      String catName, String dbName, String tblName, GetPartitionsArgs args) 
throws TException {
+    List<Partition> partitions = new LinkedList<>();
+    boolean hasUnknownPartitions = false;
+    RawStore rs = getMS();
+    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 max = args.getMax() < 0 ? partitionLimit + 1 : 
Math.min(args.getMax(), partitionLimit + 1);
+      List<String> partNames = rs.listPartitionNames(catName, dbName, tblName, 
args.getDefaultPartName(), args.getExpr(), null, (short) max);

Review Comment:
   I think in this case, we shouldn't cast the `max` to short, maybe we should 
change the type of `max` to int in the `listPartitionNames` method, what do you 
think?



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