-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-27150: Drop single partition can also support direct sql #4123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@deniskuzZ @kasakrisz @saihemanth-cloudera: Could you please review this PR? |
...lone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java
Show resolved
Hide resolved
...e-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
Show resolved
Hide resolved
|
Put the benchmark in PR description, it shows some performance improvement. FYI: @deniskuzZ @saihemanth-cloudera @VenuReddy2103 |
| if (!ms.dropPartition(catName, db_name, tbl_name, part_vals)) { | ||
| String partName = Warehouse.makePartName(tbl.getPartitionKeys(), part_vals); | ||
| if (!ms.dropPartition(catName, db_name, tbl_name, partName)) { | ||
| throw new MetaException("Unable to drop partition"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we throw the exception stack trace/reason for failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ms.dropPartition() will throw the exception, we do not need to throw this MetaException here, will remove this code.
| Assert.assertEquals(2, numPartitions); | ||
|
|
||
| try (AutoCloseable c = deadline()) { | ||
| objectStore.dropPartition(DEFAULT_CATALOG_NAME, DB1, TABLE1, value1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, I would like to keep the old tests and add new tests that takes in "partName" as argument.
| return null; | ||
| }), | ||
| null); | ||
| } catch (TException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to remove this? I think we are somehow the percentage of error records is not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
Lines 84 to 87 in 745dbf7
| public DescriptiveStatistics measure(@Nullable Runnable pre, | |
| @NotNull Runnable test, | |
| @Nullable Runnable post) { | |
| // Warmup phase |
Also the Err% should be Coefficient of variation of successful operations rather than percentage of error records:
Line 207 in 745dbf7
| double err = stats.getStandardDeviation() / mean * 100; |
saihemanth-cloudera
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you consider the given suggestions?
|
Address comments. cc: @saihemanth-cloudera |
|
Kudos, SonarCloud Quality Gate passed! |
...ne-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
Show resolved
Hide resolved
...tastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java
Show resolved
Hide resolved
saihemanth-cloudera
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you look at the given suggestions?
saihemanth-cloudera
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1
deniskuzZ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1
…eviewed by Sai Hemanth Gantasala, Denys Kuzmenko) Closes apache#4123
…eviewed by Sai Hemanth Gantasala, Denys Kuzmenko) Closes apache#4123
…eviewed by Sai Hemanth Gantasala, Denys Kuzmenko) Closes apache#4123








What changes were proposed in this pull request?
We want to reuse the
dropPartitionsInternal()method fordrop_partition_commonapi to enjoy the high performance, to achieve this we will refactor theRawStore#dropPartitionapi.Why are the changes needed?
ObjectStore#dropPartitionDoes this PR introduce any user-facing change?
No
How was this patch tested?
dropPartition:Before use direct sql:
After use direct sql: