wecharyu commented on code in PR #4123:
URL: https://github.com/apache/hive/pull/4123#discussion_r1154570802
##########
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:
I followed the `benchmarkDropPartitions()` and some others, catching
exception here should have nothing to do with benchmark statistics, because the
result statistic is in `measure()` method:
https://github.com/apache/hive/blob/745dbf7059de93a74bceda5e5acbb293008771dc/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/MicroBenchmark.java#L84-L87
Also the `Err%` should be **Coefficient of variation** of successful
operations rather than percentage of error records:
https://github.com/apache/hive/blob/745dbf7059de93a74bceda5e5acbb293008771dc/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/BenchmarkSuite.java#L207
--
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]