cxzl25 commented on code in PR #5141:
URL: https://github.com/apache/hive/pull/5141#discussion_r1547105782


##########
standalone-metastore/metastore-tools/metastore-benchmarks/src/main/java/org/apache/hadoop/hive/metastore/tools/HMSBenchmarks.java:
##########
@@ -416,15 +416,31 @@ static DescriptiveStatistics 
benchmarkGetPartitionsByFilter(@NotNull MicroBenchm
     final HMSClient client = data.getClient();
     String dbName = data.dbName;
     String tableName = data.tableName;
+    List<String> partitionList = Arrays.asList("date", "hour");
 
-    BenchmarkUtils.createPartitionedTable(client, dbName, tableName);
+    BenchmarkUtils.createPartitionedTable(client, dbName, tableName, 
partitionList);
     try {
-      addManyPartitionsNoException(client, dbName, tableName, null,
-              Collections.singletonList("d"), count);
-      return bench.measure(
+      try {
+        Table table = client.getTable(dbName, tableName);
+        List<Partition> partitionValueList = new ArrayList<>();
+        for (int i = 0; i < count / 24; i++) {
+          for (int j = 0; j < 24; j++) {
+            List<String> partValues = new ArrayList<>();
+            partValues.add("date" + i);
+            partValues.add("hour" + j);
+            Partition partition = new Util.PartitionBuilder(table)
+                    .withValues(partValues).build();
+            partitionValueList.add(partition);
+          }
+        }
+        client.addPartitions(partitionValueList);
+      } catch (TException e) {
+        throw new RuntimeException(e);
+      }
+        return bench.measure(
           () ->
               throwingSupplierWrapper(() ->
-                  client.getPartitionsByFilter(dbName, tableName, 
"`date`='d0'"))

Review Comment:
   The partition field is `d`. We use the `date` field to filter here, but it 
should not work.



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