[SPARK-55855][SQL] DSv2 Transaction API foundations#54642
Open
andreaschat-db wants to merge 1 commit intoapache:masterfrom
Open
[SPARK-55855][SQL] DSv2 Transaction API foundations#54642andreaschat-db wants to merge 1 commit intoapache:masterfrom
andreaschat-db wants to merge 1 commit intoapache:masterfrom
Conversation
aokolnychyi
reviewed
Mar 6, 2026
| * The connector is responsible for detecting and resolving conflicting commits or throwing | ||
| * an exception if resolution is not possible. | ||
| * <p> | ||
| * This method must be called exactly once. Spark calls {@link #close()} immediately after |
Contributor
There was a problem hiding this comment.
"Must be called exactly once" sounds like it is controlled by connector. I think a better way to say "will be called exactly once".
I am also not sure about the last sentence on releasing resources. Instead of saying "should not release resources", I think we better describe the sequencing of calls so that connectors make an informed call on their end when to do what.
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?
Currently, DSv2 is lacking the required abstractions for allowing transactionability in DML operations. This PR introduces the public Java interfaces that connectors need to implement. In particular, these are the following:
TransactionInfo— carries the transaction metadata.Transaction— represents a transaction. Exposescatalog(),commit(),abort(), andclose().TransactionalCatalogPlugin— extendsCatalogPluginwithbeginTransaction(TransactionInfo)method.This is the first in a series of PRs adding transaction support to DSv2. This PR is based on @aokolnychyi's prototype.
Why are the changes needed?
We are currently lacking the required abstractions for DSv2 connectors to implement transactions in write operations.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added a new suite to test
TransactionUtils.Was this patch authored or co-authored using generative AI tooling?
Claude Sonnet 4.6.