Skip to content

[PAIMON-9337] Support Kerberos proxy user when reading Paimon table via Hive - #9340

Open
sohurdc wants to merge 2 commits into
apache:masterfrom
sohurdc:paimon-9337
Open

[PAIMON-9337] Support Kerberos proxy user when reading Paimon table via Hive#9340
sohurdc wants to merge 2 commits into
apache:masterfrom
sohurdc:paimon-9337

Conversation

@sohurdc

@sohurdc sohurdc commented Aug 21, 2026

Copy link
Copy Markdown

Fixes #9337 (#9337)

What does this PR do?

When querying a Paimon table from Hive via HiveServer2 with a Kerberos proxy user
(hive.server2.proxy.user), the query fails with:

UnsupportedOperationException: Proxy user is not supported

This happens because KerberosLoginProvider throws unconditionally when the current
UserGroupInformation has auth method PROXY, both in isLoginPossible() and doLogin().

Unlike Spark/Flink, Hive cannot pass a keytab directly — HiveServer2 itself holds the
Kerberos credentials and proxies requests on behalf of the business user. In this case,
Paimon should simply skip its own Kerberos login and let the existing proxy credentials
work.

Changes

This fix targets the scenario where a Paimon table is read from Hive via HiveServer2
with a Kerberos proxy user (hive.server2.proxy.user).

  • isLoginPossible(): proxy user now returns true instead of throwing
    UnsupportedOperationException.
  • doLogin(): proxy user branch skips login (credentials already provided by the proxy
    mechanism) instead of throwing.
  • Remove the now-unreachable private method throwProxyUserNotSupported().
  • Update KerberosLoginProviderITCase to reflect the new behavior:
    • isLoginPossibleMustReturnTrueWithProxyUser (was: mustThrowException)
    • doLoginMustDoNothingWithProxyUser (was: mustThrowException)

Verifying this change

Run the existing ITCase:

mvn test -pl paimon-common -Dtest=KerberosLoginProviderITCase

Manual verification: after rebuilding the Hive connector, a Hive query via HiveServer2
proxy user on a Paimon table returns results normally. Ranger authorization still works
as expected (proxy user must still have the required privileges).

Does this PR introduce any user-facing change?

Yes. Hive queries on Paimon tables via HiveServer2 Kerberos proxy user no longer fail
with UnsupportedOperationException.

Does this PR introduce any breaking change?

No.

@JingsongLi

Copy link
Copy Markdown
Contributor

The test file contains a leftover, unused assertThatThrownBy import, causing CI failures due to the UnusedImports check; furthermore, the standard Hive proxy scenario is already protected by isLegal(), so the added integration coverage is insufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Hive query on Paimon table fails with 'Proxy user is not supported' when Kerberos proxy user is used

2 participants