-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fix back quoted alias of FROM subquery #1189
Merged
dai-chen
merged 4 commits into
opensearch-project:main
from
dai-chen:fix-subquery-alias-backquote
Dec 23, 2022
Merged
Fix back quoted alias of FROM subquery #1189
dai-chen
merged 4 commits into
opensearch-project:main
from
dai-chen:fix-subquery-alias-backquote
Dec 23, 2022
Conversation
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
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #1189 +/- ##
============================================
- Coverage 95.81% 95.81% -0.01%
Complexity 3521 3521
============================================
Files 352 352
Lines 9359 9358 -1
Branches 673 673
============================================
- Hits 8967 8966 -1
Misses 334 334
Partials 58 58
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
penghuo
approved these changes
Dec 22, 2022
acarbonetto
approved these changes
Dec 22, 2022
This was
linked to
issues
Dec 22, 2022
MaxKsyunz
approved these changes
Dec 23, 2022
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Dec 23, 2022
* Unquote from subquery alias Signed-off-by: Chen Dai <daichen@amazon.com> * Add comparison test case Signed-off-by: Chen Dai <daichen@amazon.com> * Add more comparison test case Signed-off-by: Chen Dai <daichen@amazon.com> * Update doc to remove limitations Signed-off-by: Chen Dai <daichen@amazon.com> Signed-off-by: Chen Dai <daichen@amazon.com> (cherry picked from commit 91ef34d)
dai-chen
added a commit
that referenced
this pull request
Jan 3, 2023
* Unquote from subquery alias Signed-off-by: Chen Dai <daichen@amazon.com> * Add comparison test case Signed-off-by: Chen Dai <daichen@amazon.com> * Add more comparison test case Signed-off-by: Chen Dai <daichen@amazon.com> * Update doc to remove limitations Signed-off-by: Chen Dai <daichen@amazon.com> Signed-off-by: Chen Dai <daichen@amazon.com> (cherry picked from commit 91ef34d) Co-authored-by: Chen Dai <daichen@amazon.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Previously, FROM subquery alias was not unquoted in AST layer. This caused back quoted symbol name pushed to symbol table and thus fall back to legacy subquery logic due to semantic exception.
Example
Take
SELECT `a`.`name` FROM (...) AS `a`
for example. In AST node, alias name ofRelationSubquery
is still`a`
and then Analyzer push`a`
to symbol table. When resolvinga
ina.name
, semantic exception is thrown because there is`a`
instead ofa
in symbol table. Please check the comments in #550 below for more details.Testing
The comparison test seems broken due to failed OpenSearch address resolving. I made local changes and ran it manually. Need to send separate PR to fix the comparison test framework.
Documentation
I don't see the limitation mentioned in our doc any more. Even very complex and nested subquery as below can be supported now. So I updated the doc to remove the limitation statement.
Issues Resolved
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.