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

Support more parameters for AD and KMEANS command, and update related documentation #515

Merged
merged 6 commits into from
Apr 13, 2022

Conversation

jackiehanyang
Copy link
Contributor

@jackiehanyang jackiehanyang commented Mar 25, 2022

Description

  • Support more and orderless parameters for AD command.
  • Support more and orderless parameters for KMENAS command.
  • Update documentation for AD and KMEANS command to include new parameters.

Issues Resolved

(#462)

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.

@jackiehanyang jackiehanyang requested a review from a team as a code owner March 25, 2022 18:51
@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2022

Codecov Report

Merging #515 (9c38c3c) into main (6771968) will decrease coverage by 0.65%.
The diff coverage is 25.64%.

@@             Coverage Diff              @@
##               main     #515      +/-   ##
============================================
- Coverage     95.24%   94.59%   -0.66%     
+ Complexity     2744     2742       -2     
============================================
  Files           276      276              
  Lines          7410     7454      +44     
  Branches        537      550      +13     
============================================
- Hits           7058     7051       -7     
- Misses          298      349      +51     
  Partials         54       54              
Flag Coverage Δ
query-workbench 62.76% <ø> (-0.16%) ⬇️
sql-engine 97.67% <25.64%> (-0.73%) ⬇️

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

Impacted Files Coverage Δ
...ensearch/sql/planner/logical/LogicalMLCommons.java 100.00% <ø> (ø)
...a/org/opensearch/sql/utils/MLCommonsConstants.java 0.00% <ø> (ø)
...ch/sql/opensearch/planner/physical/ADOperator.java 0.00% <0.00%> (ø)
...opensearch/planner/physical/MLCommonsOperator.java 12.12% <0.00%> (-18.32%) ⬇️
...ain/java/org/opensearch/sql/analysis/Analyzer.java 100.00% <100.00%> (ø)
...java/org/opensearch/sql/ppl/parser/AstBuilder.java 100.00% <100.00%> (ø)
.../org/opensearch/sql/ppl/utils/ArgumentFactory.java 100.00% <100.00%> (ø)
...ublic/components/QueryResults/QueryResultsBody.tsx 68.32% <0.00%> (-0.36%) ⬇️
...g/opensearch/sql/expression/text/TextFunction.java 100.00% <0.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 6771968...9c38c3c. Read the comment docs.

@@ -309,7 +309,7 @@ protected UnresolvedPlan aggregateResult(UnresolvedPlan aggregate, UnresolvedPla

@Override
public UnresolvedPlan visitKmeansCommand(KmeansCommandContext ctx) {
return new Kmeans(ArgumentFactory.getArgumentList(ctx));
return new Kmeans(ArgumentFactory.getArgumentMap(ctx));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you try to avoid if..else in getArgumentMap() by add label to antlr and using visitor to access each arguments? https://github.com/antlr/antlr4/blob/master/doc/parser-rules.md#alternative-labels

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tweaked the code by adding label and using visitor

@dai-chen
Copy link
Collaborator

A question about resource release: is there any problem that MachineLearningNodeClient is created in getMLPredictionResult() without close manually?

@jackiehanyang
Copy link
Contributor Author

A question about resource release: is there any problem that MachineLearningNodeClient is created in getMLPredictionResult() without close manually?

@dai-chen MachineLearningNodeClient is a singleton, it will only be created as a single instance through the lifetime of this application, so I don't think we need to care much about disposing it?

@dai-chen
Copy link
Collaborator

A question about resource release: is there any problem that MachineLearningNodeClient is created in getMLPredictionResult() without close manually?

@dai-chen MachineLearningNodeClient is a singleton, it will only be created as a single instance through the lifetime of this application, so I don't think we need to care much about disposing it?

Okay. Asking just in case we need to close it manually. Thanks!

Signed-off-by: jackieyanghan <[email protected]>
Copy link
Collaborator

@penghuo penghuo left a comment

Choose a reason for hiding this comment

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

LGTM

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!

@penghuo penghuo added the v2.0.0 label Apr 13, 2022
@penghuo penghuo merged commit 27125c3 into opensearch-project:main Apr 13, 2022
vamsi-amazon pushed a commit that referenced this pull request Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants