-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fixed Parser Where Queries Improperly Parsed As Alias #128
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. |
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). |
sql/src/test/java/org/opensearch/sql/sql/parser/AstQualifiedNameBuilderTest.java
Show resolved
Hide resolved
sql/src/test/java/org/opensearch/sql/sql/parser/AstQualifiedNameBuilderTest.java
Show resolved
Hide resolved
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
8c5b0e6
to
f35b40f
Compare
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
In FROM_CLAUSE Mode For Error Recognition Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 gabrielf@bitquilltech.com
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_LITERAL
fragment 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.