Skip to content
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

[SPARK-38404][SQL][3.3] Improve CTE resolution when a nested CTE references an outer CTE #37760

Conversation

peter-toth
Copy link
Contributor

What changes were proposed in this pull request?

Please note that the bug in the SPARK-38404 is fixed already with #34929.
This PR is a minor improvement to the current implementation by collecting already resolved outer CTEs to avoid re-substituting already collected CTE definitions.

Why are the changes needed?

Small improvement + additional tests.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Added new test case.

…s an outer CTE

### What changes were proposed in this pull request?
Please note that the bug in the [SPARK-38404](https://issues.apache.org/jira/browse/SPARK-38404) is fixed already with apache#34929.
This PR is a minor improvement to the current implementation by collecting already resolved outer CTEs to avoid re-substituting already collected CTE definitions.

### Why are the changes needed?
Small improvement + additional tests.

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

### How was this patch tested?
Added new test case.

Closes apache#36146 from peter-toth/SPARK-38404-nested-cte-references-outer-cte.

Authored-by: Peter Toth <peter.toth@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@peter-toth
Copy link
Contributor Author

This backport is needed for #37751 (comment)

cc @cloud-fan

@cloud-fan
Copy link
Contributor

@cloud-fan
Copy link
Contributor

thanks, merging to 3.3!

cloud-fan pushed a commit that referenced this pull request Sep 6, 2022
…rences an outer CTE

### What changes were proposed in this pull request?
Please note that the bug in the [SPARK-38404](https://issues.apache.org/jira/browse/SPARK-38404) is fixed already with #34929.
This PR is a minor improvement to the current implementation by collecting already resolved outer CTEs to avoid re-substituting already collected CTE definitions.

### Why are the changes needed?
Small improvement + additional tests.

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

### How was this patch tested?
Added new test case.

Closes #37760 from peter-toth/SPARK-38404-nested-cte-references-outer-cte-3.3.

Authored-by: Peter Toth <peter.toth@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@peter-toth
Copy link
Contributor Author

@cloud-fan, for some reason this PR is still open after your merge to 3.3. Shall I close it manually?

@cloud-fan
Copy link
Contributor

let me close it

@cloud-fan cloud-fan closed this Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants