Skip to content

HIVE-29021: Update implementation for HMSHandler#get_databases #5873

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shuyouZZ
Copy link
Contributor

What changes were proposed in this pull request?

Update implementation for HMSHandler#get_databases

Why are the changes needed?

HIVE-28921 modified the HMSHandler#get_databases and re-implemented it using get_databases_req.

Here does not need to use getMS().getDatabaseObjects to get databases and then extract the name, just get the name directly using getMS().getDatabases.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Use the existing unit tests.

@shuyouZZ shuyouZZ changed the title Update implementation for HMSHandler#get_databases HIVE-29021: Update implementation for HMSHandler#get_databases Jun 16, 2025
Copy link

Copy link
Contributor

@okumin okumin left a comment

Choose a reason for hiding this comment

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

I understand this is reverting this change on HMSHandler. The intention is understandable and the implementation looks correct.

@shuyouZZ
Copy link
Contributor Author

I understand this is reverting this change on HMSHandler. The intention is understandable and the implementation looks correct.

Yes, this PR revert the previous changes

@deniskuzZ deniskuzZ requested a review from dengzhhu653 June 16, 2025 11:15
@deniskuzZ
Copy link
Member

deniskuzZ commented Jun 16, 2025

please wait for @dengzhhu653.
I think some of the request objects allow filtering out what fields need to be fetched, maybe we can do the same here

GetTablesRequest req = new GetTablesRequest(dbName);
...
GetProjectionsSpec projectionsSpec = new GetProjectionsSpec();
projectionsSpec.setFieldList(Arrays.asList("dbName", "tableName", "owner", "ownerType"));

@dengzhhu653
Copy link
Member

dengzhhu653 commented Jun 17, 2025

please wait for @dengzhhu653. I think some of the request objects allow filtering out what fields need to be fetched, maybe we can do the same here

GetTablesRequest req = new GetTablesRequest(dbName);
...
GetProjectionsSpec projectionsSpec = new GetProjectionsSpec();
projectionsSpec.setFieldList(Arrays.asList("dbName", "tableName", "owner", "ownerType"));

Thank you @deniskuzZ @shuyouZZ. This this change on HMSHandler is trying to fix the Ranger stack overflow on retrieving the owner from the database, we get the whole database and push it to validate the owner(authorization), so the Ranger has the database owner info and skips pulling the database from HMS for the owner

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