Skip to content

Conversation

@dengzhhu653
Copy link
Member

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?

@sonarqubecloud
Copy link

if (ugiTransport.getClientUGI() == null) {
ugiTransport.setClientUGI(clientUgi);
}
clientUgi = ugiTransport.getClientUGI();
Copy link
Contributor

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.

Copy link
Member Author

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

if (request.isNeedResult()) {
AddPartitionsHandler addPartsOp = AbstractOperationHandler.offer(this, request);
if (addPartsOp.success() && request.isNeedResult()) {
AddPartitionsHandler.AddPartitionsResult addPartsResult = addPartsOp.getResult();
Copy link
Contributor

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?

Copy link
Member Author

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);
Copy link
Contributor

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

Suggested change
afterExecute(resultV);
if (resultV != null && resultV.success()) {
afterExecute(resultV);
}```

Copy link
Member Author

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

@sonarqubecloud
Copy link

Copy link
Contributor

@wecharyu wecharyu left a 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.

@dengzhhu653
Copy link
Member Author

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 HMSHandler and alter table/partition in replace for HiveAlterHandler. I will create some wish tasks once this gets merged

Copy link
Contributor

@saihemanth-cloudera saihemanth-cloudera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@dengzhhu653 dengzhhu653 merged commit 6484ad3 into apache:master Jan 14, 2026
2 checks passed
@dengzhhu653 dengzhhu653 deleted the HIVE-27224 branch January 14, 2026 09:31
@dengzhhu653
Copy link
Member Author

Very appreciate for the review, @wecharyu and @saihemanth-cloudera!

@dengzhhu653
Copy link
Member Author

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 HMSHandler and alter table/partition in replace for HiveAlterHandler. I will create some wish tasks once this gets merged

Filed HIVE-29402 to track the future work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants