Skip to content

feat(hive): accept the Java owner properties - #4597

Open
Anurag-S1ngh wants to merge 2 commits into
apache:mainfrom
Anurag-S1ngh:feat/4140-hive-owner
Open

Anurag-S1ngh wants to merge 2 commits into
apache:mainfrom
Anurag-S1ngh:feat/4140-hive-owner

Conversation

@Anurag-S1ngh

Copy link
Copy Markdown
Contributor

Part of #4140

Rationale for this change

Java clients store the table owner in the hive.metastore.table.owner table property, while PyIceberg reads owner. Tables now fall back to the Java property, with owner taking precedence. For databases, hive.metastore.database.owner and hive.metastore.database.owner-type are mapped to the Thrift owner fields and removed from the database parameters, matching Java's HiveCatalog. Setting an owner type without an owner raises.

Are these changes tested?

Added tests for the Java table owner, native-key precedence, the database owner and owner type, and the owner-type-without-owner error. tests/catalog/test_hive.py passes apart from four kerberos tests that also fail on clean main because the kerberos extra is not installed locally.

Are there any user-facing changes?

Yes. The Java owner properties are accepted.

Java tables store the owner in the hive.metastore.table.owner table
property, and databases in hive.metastore.database.owner with an
optional owner-type. Read them alongside the native owner property
and map the database keys to the Thrift owner fields.

@Fokko Fokko left a comment

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.

Thanks @Anurag-S1ngh! The keys and owner-type mapping match Java. A few differences inline.

Comment thread pyiceberg/catalog/hive.py Resolved
Comment thread pyiceberg/catalog/hive.py Resolved
Fokko

This comment was marked as outdated.

Do not copy hive.metastore.table.owner into the HMS table parameters, since the owner is already stored in the Thrift owner field.

Return hive.metastore.database.owner and owner-type from load_namespace_properties, and allow removing both keys together so the owner properties round-trip.
@Anurag-S1ngh
Anurag-S1ngh requested a review from Fokko December 5, 2026 12:19

This branch has not been deployed

No deployments
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.

2 participants