-
Notifications
You must be signed in to change notification settings - Fork 138
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
Allow common keywords and scalar function name used as identifier #1191
Allow common keywords and scalar function name used as identifier #1191
Conversation
Signed-off-by: Chen Dai <daichen@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #1191 +/- ##
============================================
- Coverage 98.31% 95.83% -2.48%
- Complexity 3524 3552 +28
============================================
Files 342 356 +14
Lines 8711 9414 +703
Branches 555 673 +118
============================================
+ Hits 8564 9022 +458
- Misses 142 334 +192
- Partials 5 58 +53
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. |
4 integration tests failed. Checked one of them and found it was related to #1133. Basically it was caused by |
@acarbonetto This changes seem depend on the underscore issue in #1133 (which maybe depend on adding meta field in v2). I will pause the work now and wait for your changes. Thanks! |
Signed-off-by: Chen Dai <daichen@amazon.com>
I reverted the changes on |
Thanks. Working on it today. I'll let you know how it'll work out. If the score function is obvious to include, I'll do that too. |
Thanks! No rush. I've reverted |
integ-test/src/test/java/org/opensearch/sql/legacy/AggregationExpressionIT.java
Show resolved
Hide resolved
Signed-off-by: Chen Dai <daichen@amazon.com>
e8b924e
) * Allow score, type and scalar function name as identifier Signed-off-by: Chen Dai <daichen@amazon.com> * Revert score and ignore failed IT Signed-off-by: Chen Dai <daichen@amazon.com> * Add comparison test to address PR comment Signed-off-by: Chen Dai <daichen@amazon.com> Signed-off-by: Chen Dai <daichen@amazon.com> (cherry picked from commit 2f4924a)
) (#1212) * Allow score, type and scalar function name as identifier Signed-off-by: Chen Dai <daichen@amazon.com> * Revert score and ignore failed IT Signed-off-by: Chen Dai <daichen@amazon.com> * Add comparison test to address PR comment Signed-off-by: Chen Dai <daichen@amazon.com> Signed-off-by: Chen Dai <daichen@amazon.com> (cherry picked from commit 2f4924a) Co-authored-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai daichen@amazon.com
Description
Pending on Allow common keywords and scalar function name used as identifier #1191 (comment)score
is not used by any grammar rule. It maybe defined as keyword due to copy-paste from legacy grammar file. Remove it from lexer file to fix [BUG]score
cannot be used in field name #788.type
is reserved by relevancy function argument. Added it tokeywordsCanBeId
rule temporarily to fix [BUG] GROUP BY Missing field returns error #743. Can be removed once all relevancy function moved out of ANTLR and core engine.keywordsCanBeId
so users can use them without backquotes, such asDATE
,CURDATE
etc.a. However, I double checked MySQL grammar and our legacy grammar that all scalar function names should be allowed. In this way we don't need to add function name to
identifier
orkeywordsCanBeId
rule one by one in future.b. To make this happen, I have to remove
OpenSearchSQLIdentifierParser.g4
to avoid circular reference. Previously it maybe intended to be shared by different language. However it is not necessary now.Note that PPL identifier doesn't have this issue and thus no change required.
Reference
Testing
Add comparison test for the second ignored test.
Issues Resolved
[BUG]score
cannot be used in field name #788Check 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.