diff --git a/build.gradle b/build.gradle index 8850ebce85..cc883ef985 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,17 @@ buildscript { ext { opensearch_version = System.getProperty("opensearch.version", "2.0.0-rc1-SNAPSHOT") + isSnapshot = "true" == System.getProperty("build.snapshot", "true") + buildVersionQualifier = System.getProperty("build.version_qualifier", "rc1") + version_tokens = opensearch_version.tokenize('-') + opensearch_build = version_tokens[0] + '.0' + if (buildVersionQualifier) { + opensearch_build += "-${buildVersionQualifier}" + } + if (isSnapshot) { + // 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT (opensearch_build) + opensearch_build += "-SNAPSHOT" + } } repositories { diff --git a/opensearch/build.gradle b/opensearch/build.gradle index e8570d4610..e448933005 100644 --- a/opensearch/build.gradle +++ b/opensearch/build.gradle @@ -37,7 +37,7 @@ dependencies { implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: '2.13.2' implementation group: 'org.json', name: 'json', version:'20180813' compileOnly group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}" - implementation group: 'org.opensearch', name:'opensearch-ml-client', version: '1.3.0.0-SNAPSHOT' + implementation group: 'org.opensearch', name:'opensearch-ml-client', version: "${opensearch_build}" testImplementation('org.junit.jupiter:junit-jupiter:5.6.2') testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' diff --git a/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java b/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java index 9f2a2c99ef..3730b5725e 100644 --- a/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java +++ b/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java @@ -26,13 +26,13 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import org.opensearch.client.node.NodeClient; +import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.dataframe.DataFrame; import org.opensearch.ml.common.dataframe.Row; -import org.opensearch.ml.common.parameter.BatchRCFParams; -import org.opensearch.ml.common.parameter.FitRCFParams; -import org.opensearch.ml.common.parameter.FunctionName; -import org.opensearch.ml.common.parameter.MLAlgoParams; -import org.opensearch.ml.common.parameter.MLPredictionOutput; +import org.opensearch.ml.common.input.parameter.MLAlgoParams; +import org.opensearch.ml.common.input.parameter.rcf.BatchRCFParams; +import org.opensearch.ml.common.input.parameter.rcf.FitRCFParams; +import org.opensearch.ml.common.output.MLPredictionOutput; import org.opensearch.sql.ast.expression.Literal; import org.opensearch.sql.data.model.ExprValue; import org.opensearch.sql.planner.physical.PhysicalPlan; diff --git a/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperator.java b/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperator.java index 863df58011..48e21246b2 100644 --- a/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperator.java +++ b/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperator.java @@ -5,7 +5,7 @@ package org.opensearch.sql.opensearch.planner.physical; -import static org.opensearch.ml.common.parameter.FunctionName.KMEANS; +import static org.opensearch.ml.common.FunctionName.KMEANS; import static org.opensearch.sql.utils.MLCommonsConstants.CENTROIDS; import static org.opensearch.sql.utils.MLCommonsConstants.DISTANCE_TYPE; import static org.opensearch.sql.utils.MLCommonsConstants.ITERATIONS; @@ -18,13 +18,12 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import org.opensearch.client.node.NodeClient; +import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.dataframe.DataFrame; import org.opensearch.ml.common.dataframe.Row; -import org.opensearch.ml.common.parameter.FunctionName; -import org.opensearch.ml.common.parameter.KMeansParams; -import org.opensearch.ml.common.parameter.MLAlgoParams; -import org.opensearch.ml.common.parameter.MLPredictionOutput; -import org.opensearch.sql.ast.expression.Argument; +import org.opensearch.ml.common.input.parameter.MLAlgoParams; +import org.opensearch.ml.common.input.parameter.clustering.KMeansParams; +import org.opensearch.ml.common.output.MLPredictionOutput; import org.opensearch.sql.ast.expression.Literal; import org.opensearch.sql.data.model.ExprValue; import org.opensearch.sql.planner.physical.PhysicalPlan; diff --git a/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorActions.java b/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorActions.java index 21b232c031..61892abe16 100644 --- a/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorActions.java +++ b/opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorActions.java @@ -15,16 +15,16 @@ import java.util.concurrent.TimeUnit; import org.opensearch.client.node.NodeClient; import org.opensearch.ml.client.MachineLearningNodeClient; +import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.dataframe.ColumnMeta; import org.opensearch.ml.common.dataframe.ColumnValue; import org.opensearch.ml.common.dataframe.DataFrame; import org.opensearch.ml.common.dataframe.DataFrameBuilder; import org.opensearch.ml.common.dataframe.Row; import org.opensearch.ml.common.dataset.DataFrameInputDataset; -import org.opensearch.ml.common.parameter.FunctionName; -import org.opensearch.ml.common.parameter.MLAlgoParams; -import org.opensearch.ml.common.parameter.MLInput; -import org.opensearch.ml.common.parameter.MLPredictionOutput; +import org.opensearch.ml.common.input.MLInput; +import org.opensearch.ml.common.input.parameter.MLAlgoParams; +import org.opensearch.ml.common.output.MLPredictionOutput; import org.opensearch.sql.data.model.ExprBooleanValue; import org.opensearch.sql.data.model.ExprDoubleValue; import org.opensearch.sql.data.model.ExprFloatValue; @@ -145,8 +145,10 @@ protected Map convertResultRowIntoExprValue(ColumnMeta[] colu * @param resultRowIter result row iterator * @return result in ExprTupleValue format */ - protected ExprTupleValue buildResult(Iterator inputRowIter, DataFrame inputDataFrame, - MLPredictionOutput predictionResult, Iterator resultRowIter) { + protected ExprTupleValue buildResult(Iterator inputRowIter, + DataFrame inputDataFrame, + MLPredictionOutput predictionResult, + Iterator resultRowIter) { ImmutableMap.Builder resultSchemaBuilder = new ImmutableMap.Builder<>(); resultSchemaBuilder.putAll(convertRowIntoExprValue(inputDataFrame.columnMetas(), inputRowIter.next())); diff --git a/opensearch/src/test/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorTest.java b/opensearch/src/test/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorTest.java index 0d14e67f74..20d2f633dd 100644 --- a/opensearch/src/test/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorTest.java +++ b/opensearch/src/test/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorTest.java @@ -37,10 +37,9 @@ import org.opensearch.ml.client.MachineLearningNodeClient; import org.opensearch.ml.common.dataframe.DataFrame; import org.opensearch.ml.common.dataframe.DataFrameBuilder; -import org.opensearch.ml.common.parameter.MLInput; -import org.opensearch.ml.common.parameter.MLPredictionOutput; +import org.opensearch.ml.common.input.MLInput; +import org.opensearch.ml.common.output.MLPredictionOutput; import org.opensearch.sql.ast.dsl.AstDSL; -import org.opensearch.sql.ast.expression.Argument; import org.opensearch.sql.ast.expression.Literal; import org.opensearch.sql.data.model.ExprIntegerValue; import org.opensearch.sql.data.model.ExprTupleValue;