-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-27224: Enhance drop table/partition command #5851
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
|
e603abc to
e54f5a9
Compare
| if (ugiTransport.getClientUGI() == null) { | ||
| ugiTransport.setClientUGI(clientUgi); | ||
| } | ||
| clientUgi = ugiTransport.getClientUGI(); |
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.
Is this line unnecessary? clientUgi is already initialized.
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.
The ugi is identical: https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java#L483-L491,
reuse the ugi cached in ugiTransport if possible so the connection will get the same FileSystem instance from cache in the whole lifetime
...ne-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
Outdated
Show resolved
Hide resolved
| if (request.isNeedResult()) { | ||
| AddPartitionsHandler addPartsOp = AbstractOperationHandler.offer(this, request); | ||
| if (addPartsOp.success() && request.isNeedResult()) { | ||
| AddPartitionsHandler.AddPartitionsResult addPartsResult = addPartsOp.getResult(); |
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 we store the partition list in the AddPartitionsResult and return it directly here?
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.
no enough, the addPartsOp.success() need to check on the state(success or not) of addPartsOp.getResult()
| if (async) { | ||
| OPID_CLEANER.schedule(() -> OPID_TO_HANDLER.remove(id), 1, TimeUnit.HOURS); | ||
| } | ||
| afterExecute(resultV); |
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.
If afterExecute() is needed only when the execute() is success, we can check the result here
| afterExecute(resultV); | |
| if (resultV != null && resultV.success()) { | |
| afterExecute(resultV); | |
| }``` |
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.
the afterExecute is also called in case of failure to free up some resources the handler might hold
|
wecharyu
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(non-binding), it's a nice enhance to such heavy operations and a good start to split the huge HMSHandler class.
If we have some cycles, we can separate the create table/database, truncate table, and set/update stats from the |
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
|
Very appreciate for the review, @wecharyu and @saihemanth-cloudera! |
Filed HIVE-29402 to track the future work |



What changes were proposed in this pull request?
Why are the changes needed?
Does this PR introduce any user-facing change?
How was this patch tested?