-
Notifications
You must be signed in to change notification settings - Fork 0
Added allowance for argument zero_terms_query to be any case. Allowed… #95
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
Added allowance for argument zero_terms_query to be any case. Allowed… #95
Conversation
| while (iterator.hasNext()) { | ||
| NamedArgumentExpression arg = (NamedArgumentExpression) iterator.next(); | ||
| if (!queryBuildActions.containsKey(arg.getArgName())) { | ||
| String argNormalized = arg.getArgName().toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The isLowerCase may fail if arg.getArgName() doesn't exist.
...st/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchPhraseQueryTest.java
Show resolved
Hide resolved
...st/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchPhraseQueryTest.java
Show resolved
Hide resolved
Yury-Fridlyand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL/PPL parser is already case-insensitive. The goal is to change case for some parameter values.
See example from main:
opensearchsql> select * from logs where simple_query_string(['*'], 'CLR', AnAlYZer = 'standard');
Output longer than terminal width
Do you want to display data vertically for better visual effect? [y/N]: y
opensearchsql> select * from logs where simple_query_string(['*'], 'CLR', analyzer = 'stAndaRd');
TransportError(500, 'SearchPhaseExecutionException', {'error': {'type': 'SearchPhaseExecutionException', 'reason': 'Error occurred in OpenSearch engine: all shards failed', 'details': 'Shard[0]: [logs/uHvAufvyREut9LnosEX2yg] QueryShardException[[simple_query_string] analyzer [stAndaRd] not found]\n\nFor more details, please send request for Json format to see the raw response from OpenSearch engine.'}, 'status': 503})
So all calls for analyzer's value should be wrapped by .toLower():
.put("analyzer", (b, v) -> b.analyzer(v.stringValue()))like you did for ZeroTermsQuery and Flags. Boost has double type, nothing to convert there, but what about Operator, DefaultOperator and so on?
...a/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/MatchPhraseQuery.java
Outdated
Show resolved
Hide resolved
|
@MitchellGale-BitQuill the conflicts need to be resolved and SQL Java CI should pass as well. |
… is surrounded by same type of quote (opensearch-project#696) Signed-off-by: mitchellg <[email protected]> Co-authored-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Yury Fridlyand <[email protected]>
… outside of main OS sql project (opensearch-project#704) Signed-off-by: mitchellg <[email protected]>
* Add support for highlight to parser and AstExpressionBuilder Signed-off-by: MaxKsyunz <[email protected]> * Add unit test for highlight in AstExpressionBuilder Signed-off-by: MaxKsyunz <[email protected]> * Add unit test for highlight in AstBuilderTest Signed-off-by: MaxKsyunz <[email protected]> * Support highlight as an Unresolved expression. Signed-off-by: MaxKsyunz <[email protected]> * Represent highlight as UnresolvedExpression. Signed-off-by: MaxKsyunz <[email protected]> * Support highlight in Analyzer. Signed-off-by: MaxKsyunz <[email protected]> * Treat highlight as a proper function in AST In particular, highlightField is an expression now. Signed-off-by: MaxKsyunz <[email protected]> * Add support for highlight in Analyzer HighlightFunction is converted to LogicalHighlight logical plan. Signed-off-by: MaxKsyunz <[email protected]> * Add a simple IT test for highlight. Signed-off-by: MaxKsyunz <[email protected]> * Register highlight function in the BuiltInFunctionRepository Signed-off-by: MaxKsyunz <[email protected]> * Partial support for highlight in physical plan. Signed-off-by: MaxKsyunz <[email protected]> * Add HighlightOperator. Signed-off-by: MaxKsyunz <[email protected]> * Highlight alpha complete. Signed-off-by: MaxKsyunz <[email protected]> * Initial implementation to upporting highlight('*') Signed-off-by: forestmvey <[email protected]> * Add support for multiple highlight calls in select statement. Signed-off-by: forestmvey <[email protected]> * Removed OpenSearchLogicalIndexScan highlightFields and dependencies. Improved test coverage and fixing checkstyle errors. Signed-off-by: forestmvey <[email protected]> * Added HighlightExpressionTest Signed-off-by: forestmvey <[email protected]> * Added javadocs, minor PR revisions, and fixed jacoco errors by improving coverage for OpenSearchIndexScan Signed-off-by: forestmvey <[email protected]> * Code cleanup, adding parsing failure tests, and adding tests for highlight acceptance as a string literal as well as qualified name. Signed-off-by: forestmvey <[email protected]> * Removing HighlightOperator functionality and unnecessary visitHighlight call in PhysicalPlanNodeVisitor.. Signed-off-by: forestmvey <[email protected]> * Adding highlight function to functions.rst and removing unecessary function call in OpenSearchIndexScan. Signed-off-by: forestmvey <[email protected]> * Change highlight fields returned format to array list. Changed highlight all and wildcard to unsupported to open up output formatting changes for multiple returned highlight fields. Change tests for updated coverage and disable highlight all and wildcard tests. Signed-off-by: forestmvey <[email protected]> * Fix bug where invalid schema name was being used for returned highlight fields Signed-off-by: forestmvey <[email protected]> * Fix failing integration tests due to schema changes for highlight expression type. Signed-off-by: forestmvey <[email protected]> Co-authored-by: MaxKsyunz <[email protected]>
534aa05 to
145b0c5
Compare
Codecov Report
@@ Coverage Diff @@
## Integ-RelFunc_changeCaseWhereAppropriate #95 +/- ##
==============================================================================
+ Coverage 97.74% 97.77% +0.02%
- Complexity 2858 2882 +24
==============================================================================
Files 273 276 +3
Lines 7020 7086 +66
Branches 442 447 +5
==============================================================================
+ Hits 6862 6928 +66
Misses 157 157
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
… is surrounded by same type of quote (opensearch-project#696) Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: Yury Fridlyand <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
…ed functions Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
145b0c5 to
6b2802a
Compare
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
…ed functions Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
Signed-off-by: mitchellg <[email protected]>
…ub.com/Bit-Quill/opensearch-project-sql into dev-RelFunc_changeCaseWhereAppropriate
|
#103 PR remade in 103 |
Signed-off-by: Mitchell Gale [email protected]
Description
Allows for any case on argument name for relevancy based function (Match Phrase Prefix, Simple Query String, Match Bool Prefix, Match, Multi-Match, Query String, Relevance, Simple Query String).
e.g.
AnalyZercan work instead of justanalyzerZero_Terms_Querycan work instead of justzero_terms_queryBOOstcan work instead of justboostAllows for
zero_term_queryarguments to be of any case.e.g.
Allcan work instead ofallCheck 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.