Skip to content

HIVE-29865: Fix metastore database filter context returning null DB names - #6744

Open
tanishq-chugh wants to merge 1 commit into
apache:masterfrom
tanishq-chugh:hms-db-filter-context
Open

HIVE-29865: Fix metastore database filter context returning null DB names#6744
tanishq-chugh wants to merge 1 commit into
apache:masterfrom
tanishq-chugh:hms-db-filter-context

Conversation

@tanishq-chugh

@tanishq-chugh tanishq-chugh commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Update the HivePrivilegeObject constructor being used in DatabaseFilterContext

Why are the changes needed?

To Prevent Null DB Names being returned with HiveMetaStoreAuthorizer filter hook

Does this PR introduce any user-facing change?

Yes, Fixes the NPE in Iceberg REST Catalog and end-user does not encounter Null Db Names when using HiveMetaStoreAuthorizer filter hook

How was this patch tested?

Manual Testing + Added a UT

@tanishq-chugh tanishq-chugh changed the title [WIP] Fix metastore database filter context returning null DB names HIVE-29865: Fix metastore database filter context returning null DB names Sep 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

ret.add(getHivePrivilegeObject(db));
} else {
HivePrivilegeObject hivePrivilegeObject = new HivePrivilegeObject(type, dbName);
HivePrivilegeObject hivePrivilegeObject = new HivePrivilegeObject(type, catName, dbName, dbName);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was able to repro the issue in my setup as well 👍🏻
@tanishq-chugh , 1 question, why objectName i.e 4th paramerter is dbName?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In L90, when DB != null, getHivePrivilegeObject(db) we are setting (type, catlaog, db, null). So in fix I think 4th param should be null.

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.

3 participants