HIVE-29021: Update implementation for HMSHandler#get_databases
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.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
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
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"));
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
@shuyouZZ, since it works as designed, can we close the PR? Or am I missing something, and it's still needed?
No response received from the author, so closing this