Skip to content

Conversation

@yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented Jul 4, 2025

What changes were proposed in this pull request?

This PR makes CACHE TABLE commands atomic while encountering execution errors

Why are the changes needed?

For now, when an AnalysisException occurs, no cache or view will be created, but an execution one occurs, a view or an erroneous 'cache' is created.

Does this PR introduce any user-facing change?

Yes, but it's a bugfix. It only affects rare corner case that a user leverages this bug to create an erroneous 'cache'/view for some particular purposes

How was this patch tested?

new tests

Was this patch authored or co-authored using generative AI tooling?

no

@github-actions github-actions bot added the SQL label Jul 4, 2025
@yaooqinn yaooqinn requested a review from cloud-fan July 4, 2025 06:57
@yaooqinn yaooqinn closed this in 08e43d3 Jul 4, 2025
yaooqinn added a commit that referenced this pull request Jul 4, 2025
…g execution errors

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

This PR makes CACHE TABLE commands atomic while encountering execution errors

### Why are the changes needed?

For now, when an AnalysisException occurs, no cache or view will be created, but an execution one occurs, a view or an erroneous 'cache' is created.

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

Yes, but it's a bugfix. It only affects rare corner case that a user leverages this bug to create an erroneous 'cache'/view for some particular purposes

### How was this patch tested?
new tests

### Was this patch authored or co-authored using generative AI tooling?
no

Closes #51374 from yaooqinn/SPARK-52684.

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
(cherry picked from commit 08e43d3)
Signed-off-by: Kent Yao <yao@apache.org>
@yaooqinn
Copy link
Member Author

yaooqinn commented Jul 4, 2025

Merged to master and 4.0, thank you @cloud-fan

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you, @yaooqinn and @cloud-fan .

Could you make a backport to branch-3.5, @yaooqinn ?

cc @peter-toth

@yaooqinn
Copy link
Member Author

yaooqinn commented Jul 7, 2025

Thank you @dongjoon-hyun, I made #51386 for 3.5.

zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 14, 2025
…g execution errors

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

This PR makes CACHE TABLE commands atomic while encountering execution errors

### Why are the changes needed?

For now, when an AnalysisException occurs, no cache or view will be created, but an execution one occurs, a view or an erroneous 'cache' is created.

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

Yes, but it's a bugfix. It only affects rare corner case that a user leverages this bug to create an erroneous 'cache'/view for some particular purposes

### How was this patch tested?
new tests

### Was this patch authored or co-authored using generative AI tooling?
no

Closes apache#51374 from yaooqinn/SPARK-52684.

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
(cherry picked from commit e72f21c)
Signed-off-by: Kent Yao <yao@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants