Skip to content

Conversation

@okumin
Copy link
Contributor

@okumin okumin commented Nov 7, 2025

What changes were proposed in this pull request?

Add a prefixed message, Got exception: org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAccessControlException, to MetaException when HiveMetaStoreAuthorizer handles HiveAccessControlException, and make HiveCatalog translate it to Iceberg's ForbiddenException.

This Pull Request implements the first option in the following document, and I'm not obsessed with this option; I chose it first because the change is minimal(easy to revert). I'm open to Option 2 or 3, or another suggestion.
https://docs.google.com/document/d/1SMvIud9k5lVSzqjgCzohHH59oW5MWAwA9BW-pPr9yIc/edit?usp=sharing

https://issues.apache.org/jira/browse/HIVE-29248

Why are the changes needed?

Currently, when Ranger rejects an access, HiveMetastore throws MetaException(message:<Message thrown by Ranger>), and a Thrift client can't get more information than the error message implemented in Apache Ranger. It's inconvenient for an Iceberg client such as Spark to distinguish the root cause and Iceberg REST API can't return a proper status code, i.e., 403.

Does this PR introduce any user-facing change?

No. The error message will contain more information.

How was this patch tested?

I added integration tests to verify that thrown exceptions are handled correctly.

@sonarqubecloud
Copy link

@okumin okumin marked this pull request as ready for review November 11, 2025 07:04
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.

2 participants