Skip to content

Conversation

@cloud-fan
Copy link
Contributor

backport #46439 to 3.5

What changes were proposed in this pull request?

This is a follow-up of #38029 . Some custom check rules need to see the entire query plan tree to get some context, but #38029 breaks it as it checks the query plan of dangling CTE relations recursively.

This PR fixes it by putting back the dangling CTE relation in the main query plan and then check the main query plan.

Why are the changes needed?

Revert the breaking change to custom check rules

Does this PR introduce any user-facing change?

No for most users. This restores the behavior of Spark 3.3 and earlier for custom check rules.

How was this patch tested?

existing tests.

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

No

@github-actions github-actions bot added the SQL label May 7, 2024
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 (if CI passes). Thank you.

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented May 7, 2024

BTW, could you reiview the following INFRA PR when you have some time, @cloud-fan ? There are not many people at this point of time. Sorry for asking you.

The above is a subtask of SPARK-48094 whose deadline is 17th of May, 2024.

@dongjoon-hyun
Copy link
Member

It seems that branch-3.5 CI is broken currently. I'll merge this after fixing Python linter issue.

@dongjoon-hyun dongjoon-hyun changed the title [3.5][SPARK-48173][SQL] CheckAnalysis should see the entire query plan [SPARK-48173][SQL][3.5] CheckAnalysis should see the entire query plan May 7, 2024
dongjoon-hyun pushed a commit that referenced this pull request May 7, 2024
backport #46439 to 3.5

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

This is a follow-up of #38029 . Some custom check rules need to see the entire query plan tree to get some context, but #38029 breaks it as it checks the query plan of dangling CTE relations recursively.

This PR fixes it by putting back the dangling CTE relation in the main query plan and then check the main query plan.

### Why are the changes needed?

Revert the breaking change to custom check rules

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

No for most users. This restores the behavior of Spark 3.3 and earlier for custom check rules.

### How was this patch tested?

existing tests.

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

No

Closes #46442 from cloud-fan/check2.

Lead-authored-by: Wenchen Fan <[email protected]>
Co-authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
@dongjoon-hyun
Copy link
Member

Merged to branch-3.5.

turboFei pushed a commit to turboFei/spark that referenced this pull request Nov 6, 2025
apache#389)

* [SPARK-48173][SQL][3.5] CheckAnalysis should see the entire query plan

backport apache#46439 to 3.5

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

This is a follow-up of apache#38029 . Some custom check rules need to see the entire query plan tree to get some context, but apache#38029 breaks it as it checks the query plan of dangling CTE relations recursively.

This PR fixes it by putting back the dangling CTE relation in the main query plan and then check the main query plan.

### Why are the changes needed?

Revert the breaking change to custom check rules

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

No for most users. This restores the behavior of Spark 3.3 and earlier for custom check rules.

### How was this patch tested?

existing tests.

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

No

Closes apache#46442 from cloud-fan/check2.

Lead-authored-by: Wenchen Fan <[email protected]>
Co-authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>

* fix

---------

Signed-off-by: Dongjoon Hyun <[email protected]>
Co-authored-by: Wenchen Fan <[email protected]>
Co-authored-by: Wenchen Fan <[email protected]>
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.

2 participants