Skip to content

[Cherry-pick to branch-1.2] [#10766] fix(iceberg): skip table import for staged creates in IcebergTableHookDispatcher (#10767)#10802

Merged
roryqi merged 2 commits into
branch-1.2from
cherry-pick-12d878fa-to-branch-1.2
Apr 17, 2026
Merged

[Cherry-pick to branch-1.2] [#10766] fix(iceberg): skip table import for staged creates in IcebergTableHookDispatcher (#10767)#10802
roryqi merged 2 commits into
branch-1.2from
cherry-pick-12d878fa-to-branch-1.2

Conversation

@github-actions

Copy link
Copy Markdown

Cherry-pick Information:

  • Original commit: 12d878f
  • Target branch: branch-1.2
  • Status: ⚠️ Has conflicts - manual resolution required

Please review and resolve the conflicts before merging.

…gTableHookDispatcher (#10767)

<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
   Examples:
     - "[#123] feat(operator): Support xxx"
     - "[#233] fix: Check null before access result in xxx"
     - "[MINOR] refactor: Fix typo in variable name"
     - "[MINOR] docs: Fix typo in README"
     - "[#255] test: Fix flaky test NameOfTheTest"
   Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->

### What changes were proposed in this pull request?

When credential vending is enabled,
`IcebergTableHookDispatcher.createTable()` now
skips `importTable()` and `setTableOwner()` for staged creates
(`stageCreate=true`).
Instead, the import and ownership assignment are deferred to
`updateTable()`, which
checks if the table entity already exists in the EntityStore and, if not
(i.e., a
staged create being committed), performs the import and ownership setup
at that point.

### Why are the changes needed?

With credential vending enabled, Trino sends all CREATE TABLE requests
with
`stageCreate=true`. The Iceberg REST protocol stages the table (builds
metadata
in memory without committing) and returns vended credentials. The table
is only
committed to the catalog when the client later calls `updateTable`.

`IcebergTableHookDispatcher.createTable()` unconditionally called
`importTable()`,
which tried to load the non-existent table from the catalog and threw
`NoSuchTableException`, failing every table create when credential
vending is active.

Fix: #10766

### Does this PR introduce _any_ user-facing change?

No. This fixes an internal error that prevented table creation when
credential
vending was enabled. No API or property changes.

### How was this patch tested?

- Unit tests
- Also tested this with a dev Gravitino deployment
# Conflicts:
#	iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergTableHookDispatcher.java
@github-actions github-actions Bot requested a review from jerryshao April 16, 2026 15:18
@yuqi1129 yuqi1129 closed this Apr 16, 2026
@yuqi1129 yuqi1129 reopened this Apr 16, 2026
@roryqi roryqi merged commit fbba09e into branch-1.2 Apr 17, 2026
26 checks passed
roryqi pushed a commit that referenced this pull request Apr 17, 2026
…for staged creates in IcebergTableHookDispatcher (#10767) (#10802)

**Cherry-pick Information:**
- Original commit: 12d878f
- Target branch: `branch-1.2`
- Status: ⚠️ **Has conflicts - manual resolution required**

Please review and resolve the conflicts before merging.

---------

Co-authored-by: Bharath Krishna <bmurali@roku.com>
@jerryshao jerryshao deleted the cherry-pick-12d878fa-to-branch-1.2 branch April 23, 2026 04:20
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