Skip to content

[SPARK-52925][SQL] Return correct error message for anchor self references in rCTEs #51619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Pajaraja
Copy link
Contributor

What changes were proposed in this pull request?

Catch case when there is a self reference in the anchor, and return an error message that this is an illegal rCTE.

Why are the changes needed?

Currently the cases where rCTEs are self referenced inside the anchor return unhelpful messages which happen due to the fact that the recursive CTE isn't defined at the time.

Does this PR introduce any user-facing change?

Different error messages.

How was this patch tested?

New golden file tests that check that cover cases with self references inside the anchor.

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

No.

@github-actions github-actions bot added the SQL label Jul 22, 2025
@HyukjinKwon
Copy link
Member

Let's file a JIRA

@Pajaraja Pajaraja changed the title [MINOR][SQL] Return correct error message for anchor self references in rCTEs [SPARK-52925][SQL] Return correct error message for anchor self references in rCTEs Jul 23, 2025
@Pajaraja
Copy link
Contributor Author

Let's file a JIRA

Added

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