[ 
https://issues.apache.org/jira/browse/HIVE-27150?focusedWorklogId=854154&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-854154
 ]

ASF GitHub Bot logged work on HIVE-27150:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Mar/23 11:02
            Start Date: 31/Mar/23 11:02
    Worklog Time Spent: 10m 
      Work Description: saihemanth-cloudera commented on code in PR #4123:
URL: https://github.com/apache/hive/pull/4123#discussion_r1154338570


##########
standalone-metastore/metastore-tools/metastore-benchmarks/src/main/java/org/apache/hadoop/hive/metastore/tools/HMSBenchmarks.java:
##########
@@ -246,26 +246,24 @@ static DescriptiveStatistics 
benchmarkGetPartitions(@NotNull MicroBenchmark benc
   }
 
   static DescriptiveStatistics benchmarkDropPartition(@NotNull MicroBenchmark 
bench,
-                                                      @NotNull BenchData data) 
{
+                                                      @NotNull BenchData data,
+                                                      int count) {
     final HMSClient client = data.getClient();
     String dbName = data.dbName;
     String tableName = data.tableName;
 
     BenchmarkUtils.createPartitionedTable(client, dbName, tableName);
-    final List<String> values = Collections.singletonList("d1");
     try {
-      Table t = client.getTable(dbName, tableName);
-      Partition partition = new Util.PartitionBuilder(t)
-          .withValues(values)
-          .build();
-
       return bench.measure(
-          () -> throwingSupplierWrapper(() -> client.addPartition(partition)),
-          () -> throwingSupplierWrapper(() -> client.dropPartition(dbName, 
tableName, values)),
+          () -> addManyPartitionsNoException(client, dbName, tableName, null,
+                  Collections.singletonList("d"), count),
+          () -> throwingSupplierWrapper(() -> {
+            List<String> partNames = client.getPartitionNames(dbName, 
tableName);
+            partNames.forEach(partName ->
+                throwingSupplierWrapper(() -> client.dropPartition(dbName, 
tableName, partName)));
+            return null;
+          }),
           null);
-    } catch (TException e) {

Review Comment:
   Why do we need to remove this? I think we are somehow the percentage of 
error records is not correct. 





Issue Time Tracking
-------------------

    Worklog Id:     (was: 854154)
    Time Spent: 3h 40m  (was: 3.5h)

> Drop single partition can also support direct sql
> -------------------------------------------------
>
>                 Key: HIVE-27150
>                 URL: https://issues.apache.org/jira/browse/HIVE-27150
>             Project: Hive
>          Issue Type: Improvement
>          Components: Hive
>            Reporter: Wechar
>            Assignee: Wechar
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> *Background:*
> [HIVE-6980|https://issues.apache.org/jira/browse/HIVE-6980] supports direct 
> sql for drop_partitions, we can reuse this huge improvement in drop_partition.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to