Skip to content

Commit f008573

Browse files
committed
Clean up and spotlessApply
Signed-off-by: acarbonetto <[email protected]>
1 parent 0fb46fc commit f008573

File tree

3 files changed

+5
-41
lines changed

3 files changed

+5
-41
lines changed

core/src/main/java/org/opensearch/sql/expression/function/NestedFunctionResolver.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
import org.opensearch.sql.expression.FunctionExpression;
1313
import org.opensearch.sql.expression.env.Environment;
1414

15-
/**
16-
* Nested Function Resolver returns a builder to resolve nested function expressions
17-
*/
15+
/** Nested Function Resolver returns a builder to resolve nested function expressions */
1816
public class NestedFunctionResolver implements FunctionResolver {
1917
@Override
2018
public Pair<FunctionSignature, FunctionBuilder> resolve(FunctionSignature unresolvedSignature) {

core/src/main/java/org/opensearch/sql/expression/function/OpenSearchFunction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
import org.opensearch.sql.expression.env.Environment;
2020

2121
/**
22-
* OpenSearch functions are FunctionExpression objects used by the core analyzer
23-
* TODO: move to the OpenSearch module as part of the analyzer and optimizer refactor
22+
* OpenSearch functions are FunctionExpression objects used by the core analyzer TODO: move to the
23+
* OpenSearch module as part of the analyzer and optimizer refactor
2424
*/
2525
public class OpenSearchFunction extends FunctionExpression {
2626
private final FunctionName functionName;
2727
private final List<Expression> arguments;
2828

2929
/**
30-
* Determines if SCORE needs to be tracked on the function for relevance-based search
31-
* used by the planner for the OpenSearch request.
30+
* Determines if SCORE needs to be tracked on the function for relevance-based search used by the
31+
* planner for the OpenSearch request.
3232
*/
3333
@Getter @Setter private boolean isScoreTracked;
3434

opensearch/src/test/java/org/opensearch/sql/opensearch/expression/ExpressionTestBase.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,12 @@
2626

2727
import com.google.common.collect.ImmutableList;
2828
import com.google.common.collect.ImmutableMap;
29-
import java.util.List;
30-
import java.util.function.Function;
3129
import org.opensearch.sql.data.model.ExprValue;
32-
import org.opensearch.sql.data.type.ExprType;
33-
import org.opensearch.sql.expression.DSL;
3430
import org.opensearch.sql.expression.Expression;
35-
import org.opensearch.sql.expression.FunctionExpression;
3631
import org.opensearch.sql.expression.ReferenceExpression;
3732
import org.opensearch.sql.expression.env.Environment;
38-
import org.opensearch.sql.expression.function.BuiltinFunctionName;
39-
import org.opensearch.sql.expression.function.FunctionProperties;
4033

4134
public class ExpressionTestBase {
42-
43-
protected FunctionProperties functionProperties = new FunctionProperties();
44-
45-
protected Environment<Expression, ExprType> typeEnv;
46-
4735
protected static Environment<Expression, ExprValue> valueEnv() {
4836
return var -> {
4937
if (var instanceof ReferenceExpression) {
@@ -82,26 +70,4 @@ protected static Environment<Expression, ExprValue> valueEnv() {
8270
}
8371
};
8472
}
85-
86-
protected Environment<Expression, ExprType> typeEnv() {
87-
return typeEnv;
88-
}
89-
90-
protected Function<List<Expression>, FunctionExpression> functionMapping(
91-
BuiltinFunctionName builtinFunctionName) {
92-
switch (builtinFunctionName) {
93-
case ADD:
94-
return (expressions) -> DSL.add(expressions.get(0), expressions.get(1));
95-
case SUBTRACT:
96-
return (expressions) -> DSL.subtract(expressions.get(0), expressions.get(1));
97-
case MULTIPLY:
98-
return (expressions) -> DSL.multiply(expressions.get(0), expressions.get(1));
99-
case DIVIDE:
100-
return (expressions) -> DSL.divide(expressions.get(0), expressions.get(1));
101-
case MODULUS:
102-
return (expressions) -> DSL.modulus(expressions.get(0), expressions.get(1));
103-
default:
104-
throw new RuntimeException();
105-
}
106-
}
10773
}

0 commit comments

Comments
 (0)