Repository navigation
Fixed Parser Where Queries Improperly Parsed As Alias - #128
Closed
GabeFernandez310 wants to merge 6 commits into
Closed
GabeFernandez310 wants to merge 6 commits into
GabeFernandez310 wants to merge 6 commits into
Conversation
Codecov Report
@@ Coverage Diff @@
## integ-fix-alias-issue #128 +/- ##
===========================================================
- Coverage 95.01% 94.96% -0.05%
+ Complexity 3020 3018 -2
===========================================================
Files 294 294
Lines 8083 8083
Branches 594 594
===========================================================
- Hits 7680 7676 -4
- Misses 349 352 +3
- Partials 54 55 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Does this also fix opensearch-project#720? If so, it might be worth mentioning this issue so it can also be marked as resolved. |
GabeFernandez310
force-pushed
the
dev-fix-alias-issue
branch
2 times, most recently
from
October 6, 2022 23:46
65e21c8 to
8c5b0e6
Compare
It doesn't, since it's a separate grammar file. However, the PPL grammar has the same grammar ambiguity, and if its the same fix, we could propose the change (as a separate PR). |
acarbonetto
requested changes
Oct 7, 2022
Signed-off-by: GabeFernandez310 <[email protected]>
GabeFernandez310
force-pushed
the
dev-fix-alias-issue
branch
from
October 11, 2022 16:44
8c5b0e6 to
f35b40f
Compare
Signed-off-by: GabeFernandez310 <[email protected]>
GumpacG
reviewed
Oct 17, 2022
acarbonetto
reviewed
Oct 17, 2022
In FROM_CLAUSE Mode For Error Recognition Signed-off-by: GabeFernandez310 <[email protected]>
GabeFernandez310
marked this pull request as draft
October 18, 2022 15:54
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
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
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.
Signed-off-by: GabeFernandez310 [email protected]
Description
Multiplication in queries were treated as an alias if there is no space between * and the value.
E.g. 'SELECT 2*6'
See result of 2 with alias *6
Expected Behavior:
The result should be 12
Implemented Fix:
Removed
*fromID_LITERALfragment in lexer to fix math statement being treated as an alias, and separated rules used for tokenizing table names from other identifiers.FROM_CLAUSE. This defines a separate rule set used to properly tokenize table names which contain*because it is required in OpenSearch, but otherwise should not exist because it introduces ambiguity when tokenizing a SQL query and because it should not exist in MySQL.Issues Resolved
#265
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.