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 matchphrase as long as match_phrase (rev. B) #51

Merged

Conversation

Yury-Fridlyand
Copy link

Description

A duplicate of #49, but based on most recent code.
The proposed changes add support for matchphrase function which mapped as match_phrase.

Issues Resolved

opensearch-project#185, p.3

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.

MaxKsyunz and others added 10 commits May 10, 2022 15:53
In the parser, use tokens from the lexer instead of string literals.

Signed-off-by: MaxKsyunz <[email protected]>
Signed-off-by: Yury Fridlyand <[email protected]>
Signed-off-by: Yury Fridlyand <[email protected]>
Signed-off-by: Yury Fridlyand <[email protected]>
Signed-off-by: MaxKsyunz <[email protected]>
Signed-off-by: MaxKsyunz <[email protected]>
We confirmed that PPL does not need to support matchphrase variant.

Signed-off-by: MaxKsyunz <[email protected]>
@codecov
Copy link

codecov bot commented May 11, 2022

Codecov Report

Merging #51 (9dd6663) into dev-match_phrase-#185 (0006dd3) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@                   Coverage Diff                    @@
##             dev-match_phrase-#185      #51   +/-   ##
========================================================
  Coverage                    97.67%   97.67%           
  Complexity                    2743     2743           
========================================================
  Files                          267      267           
  Lines                         6807     6809    +2     
  Branches                       437      437           
========================================================
+ Hits                          6649     6651    +2     
  Misses                         157      157           
  Partials                         1        1           
Flag Coverage Δ
sql-engine 97.67% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...arch/storage/script/filter/FilterQueryBuilder.java 100.00% <ø> (ø)
...h/sql/expression/function/BuiltinFunctionName.java 100.00% <100.00%> (ø)
...h/sql/expression/function/OpenSearchFunctions.java 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0006dd3...9dd6663. Read the comment docs.

@@ -35,4 +35,17 @@ void match_in_having() throws IOException {
verifyDataRows(result, rows("Bates"));
}

@Test
void match_phrase_in_where() throws IOException {
JSONObject result = executeQuery("SELECT firstname WHERE match_phrase(lastname, 'Bates')");

Choose a reason for hiding this comment

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

Don't these SELECT statements need FROM clauses?

Choose a reason for hiding this comment

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

You are right -- removed until the tests work.

@MaxKsyunz MaxKsyunz changed the base branch from dev-match_phrase-#185 to integ-match_phrase-#185 May 11, 2022 17:03
@MaxKsyunz MaxKsyunz changed the base branch from integ-match_phrase-#185 to dev-match_phrase-#185 May 11, 2022 17:11
@MaxKsyunz MaxKsyunz requested a review from forestmvey May 12, 2022 07:44
@MaxKsyunz MaxKsyunz force-pushed the dev-match_phrase-#185-matchphrase_revB branch from 89c44ed to 2b95ff1 Compare May 12, 2022 07:45
@Yury-Fridlyand Yury-Fridlyand merged commit ff6ae57 into dev-match_phrase-#185 May 12, 2022
@MaxKsyunz MaxKsyunz deleted the dev-match_phrase-#185-matchphrase_revB branch April 27, 2023 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants