Skip to content
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

Add Support For Legacy Syntax For Match Function In New Engine #1090

Conversation

GabeFernandez310
Copy link
Contributor

@GabeFernandez310 GabeFernandez310 commented Nov 18, 2022

Description

Adds match_query and matchquery as alternate syntax for match function which currently exists in OpenSearch.
This is being done to support legacy syntax.

Queries can be performed using the following syntax :

matchquery(field, 'query')
match_query(field, 'query')

Example:

SELECT field FROM index WHERE matchquery(field, 'query');
SELECT field FROM index WHERE match_query(field, 'query');

These queries should return the same result as match(field, 'query')

Issues Resolved

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

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.

GabeFernandez310 and others added 15 commits November 11, 2022 15:45
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>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
…h-function-alternate

Add Match_query And Matchquery As Alternate Syntax for Match Function
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>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
@GabeFernandez310 GabeFernandez310 requested a review from a team as a code owner November 18, 2022 21:42
@GabeFernandez310 GabeFernandez310 changed the title Integ add legacy syntax for match function Add Support for Legacy Syntax For Match Function In New Engine Nov 18, 2022
@GabeFernandez310 GabeFernandez310 changed the title Add Support for Legacy Syntax For Match Function In New Engine Add Support For Legacy Syntax For Match Function In New Engine Nov 18, 2022
Yury-Fridlyand
Yury-Fridlyand previously approved these changes Nov 18, 2022
acarbonetto
acarbonetto previously approved these changes Nov 22, 2022
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
…om:Bit-Quill/opensearch-project-sql into integ-add-legacy-syntax-for-match-function-alternate
@GabeFernandez310 GabeFernandez310 requested review from acarbonetto and removed request for dai-chen November 23, 2022 16:37
@codecov-commenter
Copy link

Codecov Report

Merging #1090 (4887d94) into 2.x (03f30e3) will decrease coverage by 35.50%.
The diff coverage is n/a.

@@              Coverage Diff              @@
##                2.x    #1090       +/-   ##
=============================================
- Coverage     98.27%   62.76%   -35.51%     
=============================================
  Files           327       10      -317     
  Lines          8457      658     -7799     
  Branches        553      119      -434     
=============================================
- Hits           8311      413     -7898     
- Misses          142      192       +50     
- Partials          4       53       +49     
Flag Coverage Δ
query-workbench 62.76% <ø> (?)
sql-engine ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ain/java/org/opensearch/sql/analysis/Analyzer.java
...alysis/DataSourceSchemaIdentifierNameResolver.java
...rg/opensearch/sql/analysis/ExpressionAnalyzer.java
...c/main/java/org/opensearch/sql/expression/DSL.java
...expression/function/BuiltinFunctionRepository.java
...h/sql/expression/function/OpenSearchFunctions.java
...opensearch/sql/expression/span/SpanExpression.java
...ch/sql/planner/optimizer/LogicalPlanOptimizer.java
...l/planner/optimizer/rule/MergeFilterAndFilter.java
...arch/sql/planner/physical/AggregationOperator.java
... and 323 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

@dai-chen dai-chen added enhancement New feature or request legacy Issues related to legacy query engine to be deprecated labels Nov 28, 2022
@dai-chen dai-chen merged commit 06b8a29 into opensearch-project:2.x Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request legacy Issues related to legacy query engine to be deprecated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants