HIVE-29450: Iceberg: Multi-table, multi-statement txn support#6310
Open
deniskuzZ wants to merge 3 commits intoapache:masterfrom
Open
HIVE-29450: Iceberg: Multi-table, multi-statement txn support#6310deniskuzZ wants to merge 3 commits intoapache:masterfrom
deniskuzZ wants to merge 3 commits intoapache:masterfrom
Conversation
2341278 to
7b1a732
Compare
7b1a732 to
a529120
Compare
270b905 to
e892e6e
Compare
e892e6e to
f3dd6b3
Compare
c51e09f to
f0d11a2
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements atomic multi-table, multi-statement transaction support for Iceberg tables through HMS. The implementation introduces a pluggable transaction coordinator architecture that enables Iceberg to stage metadata changes across multiple tables and commit them atomically via a new HMS batch update endpoint.
Changes:
- Adds
update_table_paramsThrift RPC for atomic multi-table parameter updates with CAS semantics - Introduces
TxnCoordinatorabstraction inDbTxnManagerfor pluggable transaction coordination - Implements
HiveTxnCoordinatorto batch Iceberg snapshot commits across tables in explicit transactions or multi-table inserts - Refactors SQL direct update logic into reusable base classes (
DirectSqlBase,DirectSqlUpdateParams)
Reviewed changes
Copilot reviewed 64 out of 67 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| hive_metastore.thrift | Adds TableParamsUpdate struct and update_table_params RPC |
| RawStore.java, CachedStore.java, ObjectStore.java | Implements updateTableParams interface |
| MetaStoreDirectSql.java | Adds updateTableParams with CAS validation and batch SQL updates |
| DirectSqlBase.java, DirectSqlUpdateParams.java | Refactors parameter update logic into reusable components |
| DirectSqlUpdatePart.java | Extends DirectSqlBase and delegates to DirectSqlUpdateParams |
| TxnCoordinator.java | New interface for transaction-level coordination hooks |
| HiveTxnManager.java, DbTxnManager.java | Adds pluggable TxnCoordinator support |
| AcidTxnCoordinator.java | Default ACID transaction coordinator implementation |
| HiveTxnCoordinator.java | Iceberg multi-table atomic commit coordinator |
| HiveTransaction.java, StagingTableOperations.java | Stages Iceberg metadata for batch HMS updates |
| HiveIcebergOutputCommitter.java, IcebergAcidUtil.java | Integrates staged transactions |
| Driver.java, DriverTxnHandler.java, DriverContext.java | Tracks output table count and improves transaction handling |
| SessionStateUtil.java | Adds output table count tracking |
| ReExecuteOnWriteConflictPlugin.java | Enhances retry logic for commit failures |
| Test files | Adds comprehensive concurrent execution tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b91508e to
cd30add
Compare
cd30add to
a85ebf8
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changes were proposed in this pull request?
The commit introduces an atomic multi-table commit path for Iceberg tables through HMS. The flow:
Why are the changes needed?
Enables multi-table, multi-statement transactions support
Does this PR introduce any user-facing change?
No
How was this patch tested?
mvn test -Dtest=TestIcebergCliDriver -Dqfile=iceberg_multi_table_txn.q