-
Notifications
You must be signed in to change notification settings - Fork 179
Fix back quoted alias of FROM subquery #1189
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
Conversation
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (95.81%) is below the target coverage (99.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ 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. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
* Unquote from subquery alias Signed-off-by: Chen Dai <[email protected]> * Add comparison test case Signed-off-by: Chen Dai <[email protected]> * Add more comparison test case Signed-off-by: Chen Dai <[email protected]> * Update doc to remove limitations Signed-off-by: Chen Dai <[email protected]> Signed-off-by: Chen Dai <[email protected]> (cherry picked from commit 91ef34d)
* Unquote from subquery alias Signed-off-by: Chen Dai <[email protected]> * Add comparison test case Signed-off-by: Chen Dai <[email protected]> * Add more comparison test case Signed-off-by: Chen Dai <[email protected]> * Update doc to remove limitations Signed-off-by: Chen Dai <[email protected]> Signed-off-by: Chen Dai <[email protected]> (cherry picked from commit 91ef34d) Co-authored-by: Chen Dai <[email protected]>
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 ofRelationSubqueryis still`a`and then Analyzer push`a`to symbol table. When resolvingaina.name, semantic exception is thrown because there is`a`instead ofain 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.