Skip to content

feat(catalog): hadoop cli integration#1034

Merged
zeroshade merged 5 commits into
apache:mainfrom
tanmayrauth:feat/hadoop-cli-integration
May 7, 2026
Merged

feat(catalog): hadoop cli integration#1034
zeroshade merged 5 commits into
apache:mainfrom
tanmayrauth:feat/hadoop-cli-integration

Conversation

@tanmayrauth
Copy link
Copy Markdown
Contributor

7: CLI integration
Added a case catalog.Hadoop: branch to the catalog switch in cmd/iceberg/main.go, wire the cfg.Warehouse property, and add the blank import for catalog/hadoop.

@tanmayrauth tanmayrauth requested a review from zeroshade as a code owner May 7, 2026 00:18
Copy link
Copy Markdown
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

add updates to the README for the support please

Comment thread catalog/hadoop/hadoop.go Outdated
Comment on lines +401 to +404
// writeMetadataLocationKey is the Java Iceberg property that allows relocating
// metadata to a custom path. The Hadoop catalog forbids this because it derives
// metadata paths from the table identifier.
const writeMetadataLocationKey = "write.metadata.location"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should this be a constant at the catalog package level or in table properties instead of being in the hadoop package?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, originally scoped it to the hadoop package since it was only used there for the rejection check, but table/properties.go is the right home given that's where all the other write.metadata.* keys live. Moved it there as a public WriteMetadataLocationKey constant.

…p catalog

Implement the three core table operations:

- CreateTable: validates namespace exists, rejects custom locations,
  writes v1.metadata.json via temp-file+rename, updates version hint
- LoadTable: uses findVersion with three-tier fallback, delegates to
  table.NewFromLocation for metadata parsing
- CheckTableExists: delegates to isTableDir

Relates to apache#798

Depends-on: PR 2 (version-hint), PR 3 (namespace-ops)
Depended-on-by: PR 6 (CommitTable)
Implement the full atomic commit flow:

1. Load current table (nil for create-via-commit)
2. Validate requirements against current metadata
3. Apply updates via internal.UpdateTableMetadata
4. Validate table location unchanged
5. Reject write.metadata.location property
6. Determine next version via findVersion + 1
7. Write temp file, conflict-check target, atomic rename
8. Best-effort version hint update, cleanup temp on error

Relates to apache#798

Depends-on: PR 4 (table CRUD)
Depended-on-by: PR 7 (CLI integration)
Add catalog.Hadoop case to the CLI catalog switch in cmd/iceberg/main.go,
passing the warehouse path from --warehouse flag. Import the hadoop
package to make the catalog available.

Relates to apache#798

Depends-on: PR 6 (CommitTable)
Depended-on-by: none (leaf PR)
@tanmayrauth tanmayrauth force-pushed the feat/hadoop-cli-integration branch from 9c60942 to cdef96e Compare May 7, 2026 17:26
@zeroshade zeroshade merged commit 9d8ec29 into apache:main May 7, 2026
14 checks passed
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