-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-46625] CTE with Identifier clause as reference #47180
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
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3a01831
Working CTE with session variables and Identifier clause in general.
nebojsa-db 0a7d045
Added test for string pipe inside identifier clause.
nebojsa-db 186f1f4
Split CTE substitution in to first identify all CTE defs and do CTE r…
nebojsa-db d352a53
Added new analyzer rule.
nebojsa-db 518103d
Fixed hints and nesting.
nebojsa-db 4afd30b
Refactored code to better suit split collect/resolve approach.
nebojsa-db 7df6378
Fixed nit comments.
nebojsa-db 3f573ad
Changed approach for resolving identifier clause with cte.
nebojsa-db 0601caf
Scala style fix.
nebojsa-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it more, now we need to special-case
UnresolvedWithCTERelationstwice: once inResolveReferencesto resolve session variables and once inResolveIdentifierClauseto resolve identifier and look up CTE relations.How about we make
UnresolvedWithCTERelationsan unary code, and only special case it once inResolveRelationsthat we should look up from CTE relations forUnresolvedRelationsinsideUnresolvedWithCTERelations? Sorry for the back and forth!Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worry!
Hm, issue with that approach is that
ResolveRelationsis traversing the tree in bottom up manner so we will first do table lookup instead of CTE relations lookup since it will first encounterUnresolvedRelationinstead ofUnresolvedWithCTERelations?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, it's better to keep the bottom-up resolotion.