[SPARK-56995][SQL][DML] Allow dataframe caching in the DSv2 Transaction API#56121
Open
andreaschat-db wants to merge 6 commits into
Open
[SPARK-56995][SQL][DML] Allow dataframe caching in the DSv2 Transaction API#56121andreaschat-db wants to merge 6 commits into
andreaschat-db wants to merge 6 commits into
Conversation
Contributor
|
Is this PR aiming for 4.2? |
Contributor
Author
Yes. It is an important fix for the DSv2 Transaction API. |
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.
Currently, the DSv2 Transaction API skips dataframe caching. This can cause significant performance regression to existing workloads. Dataframes cached prior to the transaction should be allowed to be reused within the transaction. Cache substitution during a transaction now delegates to the connector via
Transaction.registerScans. Spark hands every materialized scan in a candidate cached subtree to the active transaction, and the connector decides whether reusing the cached snapshots is compatible with its isolation contract.What changes were proposed in this pull request?
This transaction introduces
Transaction.registerScansin the transaction API. Check above for more details.Why are the changes needed?
Without this fix cached dataframes cannot be used in transactions. As a result, the DSv2 transaction API will introduce significant performance regression for relevant workloads.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing and new tests.
Was this patch authored or co-authored using generative AI tooling?
Opus 4.7