-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-48530][SQL] Support for local variables in SQL Scripting #49445
Open
dusantism-db
wants to merge
56
commits into
apache:master
Choose a base branch
from
dusantism-db:scripting-local-variables
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
73cb01b
first commit
dusantism-db 813d282
POC works
dusantism-db 1c08f57
make column res helper more functional
dusantism-db 18da02f
move variables map to SqlScriptingScope
dusantism-db cee5f1a
implement proper namespace (scope label name) for local variables
dusantism-db 47934ab
qualified names
dusantism-db 399d4e8
update todos
dusantism-db 6efe764
resolve catalogs + check for duplicates
dusantism-db 769607d
set variable and normalized identifiers
dusantism-db 6225956
resolve fully qualified session vars in tempvarManager only and updat…
dusantism-db 241fc05
tests first batch
dusantism-db 068e1ec
add more tests
dusantism-db 60335db
add error messages, more tests and some comments
dusantism-db 65b69d3
rename TempVariableManager.scala and add more tests
dusantism-db fe5dc7b
remove old logic for dropping variables, update tests and add more tests
dusantism-db 4f8d2c1
add cleanup for scripting execution, separate drop and create variabl…
dusantism-db ba5b8d2
fix resolvecatalogs and add more tests
dusantism-db 33f0aac
refactor to support properly setting variables
dusantism-db be6052f
add error message for system and session label names
dusantism-db 4b1e8e1
small fixes and cleanup
dusantism-db 90b106b
Fix duplicate detection for set variablwe
dusantism-db 7ba0923
Add test for DECLARE OR REPLACE but ignore it until FOR is fixed
dusantism-db cd4e932
execute immediate don't resolve vars from scripts. Problem remains wi…
dusantism-db fdf3c5a
cleanup
dusantism-db 52cbd17
Merge remote-tracking branch 'upstream/master' into scripting-local-v…
dusantism-db c134fd4
fix merge mistake
dusantism-db 3ea762d
fix merge mistake 2
dusantism-db 8e9352a
fix comments
dusantism-db 78042e3
Update CreateVar, SetVar and lookupVariable to work with Execute Imme…
dusantism-db 40ffa83
add enum for lookup variable mode
dusantism-db 4a546a4
convert scripting variable manager to threadlocal
dusantism-db 15d5554
fix e2e test
dusantism-db a2b20c5
add comment
dusantism-db e3077a4
add comment and regenerate golden files
dusantism-db 6ce8f9c
fix failing test
dusantism-db ccab52c
refactor SqlScriptingVariableManager to be LexicalThreadLocal singlet…
dusantism-db 370bf65
renames
dusantism-db 0cea838
tagging approach
dusantism-db 9895c69
Revert "tagging approach"
dusantism-db cd888dd
analysiscontext withExecuteImmediate
dusantism-db 4fe7ab5
remove into clause flag
dusantism-db 8a6b536
address comments
dusantism-db db573c1
remove parameter from lookupVariable
dusantism-db dadd517
Merge remote-tracking branch 'upstream/master' into scripting-local-v…
dusantism-db 680e5d7
resolve comments 1
dusantism-db 7d3008e
Merge remote-tracking branch 'upstream/master' into scripting-local-v…
dusantism-db 901aa6c
improve logic to work with exception handlers
dusantism-db 34677c7
add check for existing variable in set, and add comments to findVariable
dusantism-db b814b97
Introduce FakeLocalCatalog, remove sessionVariablesOnly flags and upd…
dusantism-db 8074c63
resolve comments
dusantism-db 220aeae
throw error if var not found in setvarexec
dusantism-db 45ca867
resolve comments again
dusantism-db e1f1098
update resolvecatalogs according to wenchens comments, and forbid dro…
dusantism-db 61a753f
change variableManager api to use only nameParts and VariableDefiniti…
dusantism-db f29a8fc
add test for drop session var
dusantism-db e184f8c
forbid session, builtin and sys* label names
dusantism-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 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 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 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.
An
Identifier
is already created, we can directly returnResolvedIdentifier(FakeSystemCatalog, ident)
here.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.
Sorry, what do you mean already created? Here we create the identifier, which is dependent on scripting context in the case of local variables, and then we return it in
ResolvedIdentifier(FakeSystemCatalog, ident)
after checking for errors.