Skip to content

HIVE-28898: Include table ownership details in getTableMetas() for Ra… #5770

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

Merged
merged 4 commits into from
Apr 25, 2025

Conversation

jjiang037
Copy link
Contributor

…ngerHiveAuthorizer

What changes were proposed in this pull request?

Passing table ownership information to RangerHiveAuthorizer when ranger starts using getTableMetas()

Why are the changes needed?

Ranger would fetch ownership information of table if hms doesn't provide initially.

Does this PR introduce any user-facing change?

No

Is the change a dependency upgrade?

No

How was this patch tested?

Unit test

@Aggarwal-Raghav
Copy link
Contributor

@jjiang037, thanks for the PR.

Quick question, how is it different from HIVE-27285, IIRC for both database and Table/View we are passing owner information in hivePrivObject.

@jjiang037
Copy link
Contributor Author

Hi @Aggarwal-Raghav, thanks for the review and question!

You're right—HIVE-27285 introduced ownership info (ownerName, ownerType) in TableMeta and updated filterTableMetas to work with it. But it didn’t use that info within the TableFilterContext.

This PR (HIVE-28898) addresses that gap:

Wires ownership into TableFilterContext: Adds a createFromTableMetas factory method that converts TableMeta to Table and copies ownerName and ownerType.

Populates HivePrivilegeObjects properly: getInputHObjs now includes owner info when building the list, enabling plugins like Ranger to use it.

Ensures correct flow in HMSHandler: Updates get_all_tables to fetch TableMeta (with ownership) before filtering, so it propagates down properly.

In short: HIVE-27285 exposed ownership data; this PR makes sure it’s actually used during filtering and authorization.

@dengzhhu653 dengzhhu653 merged commit 4554364 into apache:master Apr 25, 2025
6 checks passed
@jjiang037 jjiang037 deleted the HIVE-28898 branch April 26, 2025 06:44
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.

6 participants