From de6831d9af6c1acda862fae192d6e4bd37ccb1e6 Mon Sep 17 00:00:00 2001 From: Mitchell Gale Date: Wed, 2 Aug 2023 23:51:42 -0700 Subject: [PATCH] revert ast changes as was covered in spotless #1 PR for GJF. Signed-off-by: Mitchell Gale --- .../sql/ast/AbstractNodeVisitor.java | 6 ++- .../java/org/opensearch/sql/ast/Node.java | 5 +- .../org/opensearch/sql/ast/dsl/AstDSL.java | 2 +- .../sql/ast/expression/AggregateFunction.java | 2 +- .../opensearch/sql/ast/expression/Alias.java | 21 +++++--- .../sql/ast/expression/AllFields.java | 8 ++- .../opensearch/sql/ast/expression/And.java | 5 +- .../sql/ast/expression/Argument.java | 5 +- .../sql/ast/expression/AttributeList.java | 8 ++- .../sql/ast/expression/Between.java | 4 +- .../opensearch/sql/ast/expression/Case.java | 18 +++++-- .../opensearch/sql/ast/expression/Cast.java | 49 ++++++++++--------- .../sql/ast/expression/Compare.java | 1 + .../sql/ast/expression/DataType.java | 9 +++- .../sql/ast/expression/EqualTo.java | 11 +++-- .../opensearch/sql/ast/expression/Field.java | 9 +++- .../sql/ast/expression/Function.java | 8 +-- .../sql/ast/expression/HighlightFunction.java | 4 +- .../org/opensearch/sql/ast/expression/In.java | 8 +-- .../sql/ast/expression/Interval.java | 1 + .../sql/ast/expression/IntervalUnit.java | 13 +++-- .../opensearch/sql/ast/expression/Let.java | 5 +- .../sql/ast/expression/Literal.java | 6 ++- .../opensearch/sql/ast/expression/Map.java | 5 +- .../ast/expression/NestedAllTupleFields.java | 9 +++- .../opensearch/sql/ast/expression/Not.java | 5 +- .../org/opensearch/sql/ast/expression/Or.java | 5 +- .../sql/ast/expression/ParseMethod.java | 4 +- .../sql/ast/expression/QualifiedName.java | 16 +++--- .../ast/expression/RelevanceFieldList.java | 16 ++++-- .../sql/ast/expression/ScoreFunction.java | 4 +- .../opensearch/sql/ast/expression/Span.java | 6 ++- .../sql/ast/expression/SpanUnit.java | 11 +++-- .../ast/expression/UnresolvedArgument.java | 5 +- .../ast/expression/UnresolvedAttribute.java | 6 ++- .../ast/expression/UnresolvedExpression.java | 1 + .../opensearch/sql/ast/expression/When.java | 14 ++++-- .../sql/ast/expression/WindowFunction.java | 2 + .../opensearch/sql/ast/expression/Xor.java | 5 +- .../opensearch/sql/ast/statement/Explain.java | 4 +- .../opensearch/sql/ast/statement/Query.java | 4 +- .../sql/ast/statement/Statement.java | 4 +- .../java/org/opensearch/sql/ast/tree/AD.java | 1 + .../opensearch/sql/ast/tree/Aggregation.java | 31 +++++++----- .../opensearch/sql/ast/tree/CloseCursor.java | 9 +++- .../org/opensearch/sql/ast/tree/Dedupe.java | 5 +- .../org/opensearch/sql/ast/tree/Eval.java | 5 +- .../opensearch/sql/ast/tree/FetchCursor.java | 8 ++- .../org/opensearch/sql/ast/tree/Filter.java | 5 +- .../org/opensearch/sql/ast/tree/Head.java | 5 +- .../org/opensearch/sql/ast/tree/Kmeans.java | 1 + .../org/opensearch/sql/ast/tree/Limit.java | 2 + .../java/org/opensearch/sql/ast/tree/ML.java | 9 ++-- .../org/opensearch/sql/ast/tree/Paginate.java | 8 ++- .../org/opensearch/sql/ast/tree/Parse.java | 25 +++++++--- .../org/opensearch/sql/ast/tree/Project.java | 12 +++-- .../org/opensearch/sql/ast/tree/RareTopN.java | 6 ++- .../org/opensearch/sql/ast/tree/Relation.java | 18 ++++--- .../sql/ast/tree/RelationSubquery.java | 9 +++- .../org/opensearch/sql/ast/tree/Rename.java | 1 + .../org/opensearch/sql/ast/tree/Sort.java | 18 +++++-- .../sql/ast/tree/TableFunction.java | 10 +++- .../sql/ast/tree/UnresolvedPlan.java | 5 +- .../org/opensearch/sql/ast/tree/Values.java | 6 ++- 64 files changed, 373 insertions(+), 160 deletions(-) diff --git a/core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java b/core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java index 973b10310b..f02bc07ccc 100644 --- a/core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java +++ b/core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast; import org.opensearch.sql.ast.expression.AggregateFunction; @@ -61,7 +62,9 @@ import org.opensearch.sql.ast.tree.TableFunction; import org.opensearch.sql.ast.tree.Values; -/** AST nodes visitor Defines the traverse path. */ +/** + * AST nodes visitor Defines the traverse path. + */ public abstract class AbstractNodeVisitor { public T visit(Node node, C context) { @@ -70,7 +73,6 @@ public T visit(Node node, C context) { /** * Visit child node. - * * @param node {@link Node} * @param context Context * @return Return Type. diff --git a/core/src/main/java/org/opensearch/sql/ast/Node.java b/core/src/main/java/org/opensearch/sql/ast/Node.java index faaf51f221..f3147eeb43 100644 --- a/core/src/main/java/org/opensearch/sql/ast/Node.java +++ b/core/src/main/java/org/opensearch/sql/ast/Node.java @@ -3,13 +3,16 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast; import java.util.List; import lombok.EqualsAndHashCode; import lombok.ToString; -/** AST node. */ +/** + * AST node. + */ @EqualsAndHashCode @ToString public abstract class Node { diff --git a/core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java b/core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java index 75f8205173..761a502852 100644 --- a/core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java +++ b/core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java @@ -465,4 +465,4 @@ public static Parse parse(UnresolvedPlan input, ParseMethod parseMethod, return new Parse(parseMethod, sourceField, pattern, arguments, input); } -} \ No newline at end of file +} diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/AggregateFunction.java b/core/src/main/java/org/opensearch/sql/ast/expression/AggregateFunction.java index 2144338a35..e8f730d7e9 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/AggregateFunction.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/AggregateFunction.java @@ -17,7 +17,7 @@ import org.opensearch.sql.common.utils.StringUtils; /** - * Expression node of aggregate functions.
+ * Expression node of aggregate functions. * Params include aggregate function name (AVG, SUM, MAX etc.) and the field to aggregate. */ @Getter diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Alias.java b/core/src/main/java/org/opensearch/sql/ast/expression/Alias.java index 7b3078629b..4183b19a3e 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Alias.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Alias.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import lombok.AllArgsConstructor; @@ -13,10 +14,10 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; /** - * Alias abstraction that associate an unnamed expression with a name and an optional alias. The - * name and alias information preserved is useful for semantic analysis and response formatting - * eventually. This can avoid restoring the info in toString() method which is inaccurate because - * original info is already lost. + * Alias abstraction that associate an unnamed expression with a name and an optional alias. + * The name and alias information preserved is useful for semantic analysis and response + * formatting eventually. This can avoid restoring the info in toString() method which is + * inaccurate because original info is already lost. */ @AllArgsConstructor @EqualsAndHashCode(callSuper = false) @@ -25,13 +26,19 @@ @ToString public class Alias extends UnresolvedExpression { - /** Original field name. */ + /** + * Original field name. + */ private final String name; - /** Expression aliased. */ + /** + * Expression aliased. + */ private final UnresolvedExpression delegated; - /** Optional field alias. */ + /** + * Optional field alias. + */ private String alias; @Override diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/AllFields.java b/core/src/main/java/org/opensearch/sql/ast/expression/AllFields.java index b9b90ea24a..1f5d919817 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/AllFields.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/AllFields.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Collections; @@ -12,13 +13,16 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.Node; -/** Represent the All fields which is been used in SELECT *. */ +/** + * Represent the All fields which is been used in SELECT *. + */ @ToString @EqualsAndHashCode(callSuper = false) public class AllFields extends UnresolvedExpression { public static final AllFields INSTANCE = new AllFields(); - private AllFields() {} + private AllFields() { + } public static AllFields of() { return INSTANCE; diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/And.java b/core/src/main/java/org/opensearch/sql/ast/expression/And.java index 565f1eb4ab..8d8c48f3b2 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/And.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/And.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; @@ -13,7 +14,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Expression node of logic AND. */ +/** + * Expression node of logic AND. + */ @Getter @ToString @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Argument.java b/core/src/main/java/org/opensearch/sql/ast/expression/Argument.java index 4c2a485ea7..f054710a32 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Argument.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Argument.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; @@ -13,7 +14,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Argument. */ +/** + * Argument. + */ @Getter @ToString @RequiredArgsConstructor diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/AttributeList.java b/core/src/main/java/org/opensearch/sql/ast/expression/AttributeList.java index d137a83957..7e1fdb1516 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/AttributeList.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/AttributeList.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import com.google.common.collect.ImmutableList; @@ -13,12 +14,15 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Expression node that includes a list of Expression nodes. */ +/** + * Expression node that includes a list of Expression nodes. + */ @ToString @EqualsAndHashCode(callSuper = false) @AllArgsConstructor public class AttributeList extends UnresolvedExpression { - @Getter private List attrList; + @Getter + private List attrList; @Override public List getChild() { diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Between.java b/core/src/main/java/org/opensearch/sql/ast/expression/Between.java index e13c3fb187..886c9a9282 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Between.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Between.java @@ -12,7 +12,9 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.Node; -/** Unresolved expression for BETWEEN. */ +/** + * Unresolved expression for BETWEEN. + */ @Data @EqualsAndHashCode(callSuper = false) public class Between extends UnresolvedExpression { diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Case.java b/core/src/main/java/org/opensearch/sql/ast/expression/Case.java index 583bd0de97..81c74f3ea4 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Case.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Case.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import com.google.common.collect.ImmutableList; @@ -14,23 +15,29 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.Node; -/** AST node that represents CASE clause similar as Switch statement in programming language. */ +/** + * AST node that represents CASE clause similar as Switch statement in programming language. + */ @AllArgsConstructor @EqualsAndHashCode(callSuper = false) @Getter @ToString public class Case extends UnresolvedExpression { - /** Value to be compared by WHEN statements. Null in the case of CASE WHEN conditions. */ + /** + * Value to be compared by WHEN statements. Null in the case of CASE WHEN conditions. + */ private final UnresolvedExpression caseValue; /** - * Expression list that represents WHEN statements. Each is a mapping from condition to its - * result. + * Expression list that represents WHEN statements. Each is a mapping from condition + * to its result. */ private final List whenClauses; - /** Expression that represents ELSE statement result. */ + /** + * Expression that represents ELSE statement result. + */ private final UnresolvedExpression elseClause; @Override @@ -51,4 +58,5 @@ public List getChild() { public T accept(AbstractNodeVisitor nodeVisitor, C context) { return nodeVisitor.visitCase(this, context); } + } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Cast.java b/core/src/main/java/org/opensearch/sql/ast/expression/Cast.java index 2019346fb5..785c65eb95 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Cast.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Cast.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import static org.opensearch.sql.expression.function.BuiltinFunctionName.CAST_TO_BOOLEAN; @@ -32,7 +33,9 @@ import org.opensearch.sql.data.type.ExprType; import org.opensearch.sql.expression.function.FunctionName; -/** AST node that represents Cast clause. */ +/** + * AST node that represents Cast clause. + */ @AllArgsConstructor @EqualsAndHashCode(callSuper = false) @Getter @@ -40,32 +43,35 @@ public class Cast extends UnresolvedExpression { private static final Map CONVERTED_TYPE_FUNCTION_NAME_MAP = - new ImmutableMap.Builder() - .put("string", CAST_TO_STRING.getName()) - .put("byte", CAST_TO_BYTE.getName()) - .put("short", CAST_TO_SHORT.getName()) - .put("int", CAST_TO_INT.getName()) - .put("integer", CAST_TO_INT.getName()) - .put("long", CAST_TO_LONG.getName()) - .put("float", CAST_TO_FLOAT.getName()) - .put("double", CAST_TO_DOUBLE.getName()) - .put("boolean", CAST_TO_BOOLEAN.getName()) - .put("date", CAST_TO_DATE.getName()) - .put("time", CAST_TO_TIME.getName()) - .put("timestamp", CAST_TO_TIMESTAMP.getName()) - .put("datetime", CAST_TO_DATETIME.getName()) - .build(); + new ImmutableMap.Builder() + .put("string", CAST_TO_STRING.getName()) + .put("byte", CAST_TO_BYTE.getName()) + .put("short", CAST_TO_SHORT.getName()) + .put("int", CAST_TO_INT.getName()) + .put("integer", CAST_TO_INT.getName()) + .put("long", CAST_TO_LONG.getName()) + .put("float", CAST_TO_FLOAT.getName()) + .put("double", CAST_TO_DOUBLE.getName()) + .put("boolean", CAST_TO_BOOLEAN.getName()) + .put("date", CAST_TO_DATE.getName()) + .put("time", CAST_TO_TIME.getName()) + .put("timestamp", CAST_TO_TIMESTAMP.getName()) + .put("datetime", CAST_TO_DATETIME.getName()) + .build(); - /** The source expression cast from. */ + /** + * The source expression cast from. + */ private final UnresolvedExpression expression; - /** Expression that represents name of the target type. */ + /** + * Expression that represents name of the target type. + */ private final UnresolvedExpression convertedType; /** * Check if the given function name is a cast function or not. - * - * @param name function name + * @param name function name * @return true if cast function, otherwise false. */ public static boolean isCastFunction(FunctionName name) { @@ -74,8 +80,7 @@ public static boolean isCastFunction(FunctionName name) { /** * Get the cast function name for a given target data type. - * - * @param targetType target data type + * @param targetType target data type * @return cast function name corresponding */ public static FunctionName getCastFunctionName(ExprType targetType) { diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Compare.java b/core/src/main/java/org/opensearch/sql/ast/expression/Compare.java index 8ba6ba5116..25cf3e0f73 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Compare.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Compare.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/DataType.java b/core/src/main/java/org/opensearch/sql/ast/expression/DataType.java index 0b9add8f55..8755a15177 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/DataType.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/DataType.java @@ -3,13 +3,17 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.opensearch.sql.data.type.ExprCoreType; -/** The DataType defintion in AST. Question, could we use {@link ExprCoreType} directly in AST? */ +/** + * The DataType defintion in AST. + * Question, could we use {@link ExprCoreType} directly in AST? + */ @RequiredArgsConstructor public enum DataType { TYPE_ERROR(ExprCoreType.UNKNOWN), @@ -28,5 +32,6 @@ public enum DataType { TIMESTAMP(ExprCoreType.TIMESTAMP), INTERVAL(ExprCoreType.INTERVAL); - @Getter private final ExprCoreType coreType; + @Getter + private final ExprCoreType coreType; } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/EqualTo.java b/core/src/main/java/org/opensearch/sql/ast/expression/EqualTo.java index 344f3c5164..806f897abf 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/EqualTo.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/EqualTo.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; @@ -13,13 +14,17 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Expression node of binary operator or comparison relation EQUAL. */ +/** + * Expression node of binary operator or comparison relation EQUAL. + */ @ToString @EqualsAndHashCode(callSuper = false) @AllArgsConstructor public class EqualTo extends UnresolvedExpression { - @Getter private UnresolvedExpression left; - @Getter private UnresolvedExpression right; + @Getter + private UnresolvedExpression left; + @Getter + private UnresolvedExpression right; @Override public List getChild() { diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Field.java b/core/src/main/java/org/opensearch/sql/ast/expression/Field.java index 0a2d726ad4..9a8109fbe3 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Field.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Field.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import com.google.common.collect.ImmutableList; @@ -22,12 +23,16 @@ public class Field extends UnresolvedExpression { private final List fieldArgs; - /** Constructor of Field. */ + /** + * Constructor of Field. + */ public Field(UnresolvedExpression field) { this(field, Collections.emptyList()); } - /** Constructor of Field. */ + /** + * Constructor of Field. + */ public Field(UnresolvedExpression field, List fieldArgs) { this.field = field; this.fieldArgs = fieldArgs; diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Function.java b/core/src/main/java/org/opensearch/sql/ast/expression/Function.java index 1dbeae6ff8..e59bb0372b 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Function.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Function.java @@ -16,7 +16,7 @@ /** - * Expression node of scalar function.
+ * Expression node of scalar function. * Params include function name (@funcName) and function arguments (@funcArgs) */ @Getter @@ -39,8 +39,8 @@ public R accept(AbstractNodeVisitor nodeVisitor, C context) { @Override public String toString() { return String.format("%s(%s)", funcName, - funcArgs.stream() - .map(Object::toString) - .collect(Collectors.joining(", "))); + funcArgs.stream() + .map(Object::toString) + .collect(Collectors.joining(", "))); } } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/HighlightFunction.java b/core/src/main/java/org/opensearch/sql/ast/expression/HighlightFunction.java index 128d9327e8..0d4e57a78c 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/HighlightFunction.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/HighlightFunction.java @@ -13,7 +13,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Expression node of Highlight function. */ +/** + * Expression node of Highlight function. + */ @AllArgsConstructor @EqualsAndHashCode(callSuper = false) @Getter diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/In.java b/core/src/main/java/org/opensearch/sql/ast/expression/In.java index 38c1b91b43..9ce1c124cb 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/In.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/In.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; @@ -14,9 +15,10 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; /** - * Expression node of one-to-many mapping relation IN. Params include the field expression and/or - * wildcard field expression, nested field expression (@field). And the values that the field is - * mapped to (@valueList). + * Expression node of one-to-many mapping relation IN. + * Params include the field expression and/or wildcard field expression, + * nested field expression (@field). + * And the values that the field is mapped to (@valueList). */ @Getter @ToString diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Interval.java b/core/src/main/java/org/opensearch/sql/ast/expression/Interval.java index c26f829f48..84b6ba02d1 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Interval.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Interval.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Collections; diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/IntervalUnit.java b/core/src/main/java/org/opensearch/sql/ast/expression/IntervalUnit.java index 19e1b07e39..c731835a5e 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/IntervalUnit.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/IntervalUnit.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import com.google.common.collect.ImmutableList; @@ -12,7 +13,7 @@ @Getter @RequiredArgsConstructor -public enum IntervalUnit { +public enum IntervalUnit { UNKNOWN, MICROSECOND, @@ -43,11 +44,13 @@ public enum IntervalUnit { INTERVAL_UNITS = builder.add(IntervalUnit.values()).build(); } - /** Util method to get interval unit given the unit name. */ + /** + * Util method to get interval unit given the unit name. + */ public static IntervalUnit of(String unit) { return INTERVAL_UNITS.stream() - .filter(v -> unit.equalsIgnoreCase(v.name())) - .findFirst() - .orElse(IntervalUnit.UNKNOWN); + .filter(v -> unit.equalsIgnoreCase(v.name())) + .findFirst() + .orElse(IntervalUnit.UNKNOWN); } } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Let.java b/core/src/main/java/org/opensearch/sql/ast/expression/Let.java index 2f63a25f10..cea2a091e5 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Let.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Let.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import com.google.common.collect.ImmutableList; @@ -13,7 +14,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Represent the assign operation. e.g. velocity = distance/speed. */ +/** + * Represent the assign operation. e.g. velocity = distance/speed. + */ @Getter @ToString @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Literal.java b/core/src/main/java/org/opensearch/sql/ast/expression/Literal.java index 80c877dd97..3ff360dbf0 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Literal.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Literal.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import com.google.common.collect.ImmutableList; @@ -13,8 +14,9 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; /** - * Expression node of literal type Params include literal value (@value) and literal data type - * (@type) which can be selected from {@link DataType}. + * Expression node of literal type + * Params include literal value (@value) and + * literal data type (@type) which can be selected from {@link DataType}. */ @Getter @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Map.java b/core/src/main/java/org/opensearch/sql/ast/expression/Map.java index 73d8d77261..45e98f127f 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Map.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Map.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; @@ -13,7 +14,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Expression node of one-to-one mapping relation. */ +/** + * Expression node of one-to-one mapping relation. + */ @Getter @ToString @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/NestedAllTupleFields.java b/core/src/main/java/org/opensearch/sql/ast/expression/NestedAllTupleFields.java index be89dd9f19..adf2025e6c 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/NestedAllTupleFields.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/NestedAllTupleFields.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Collections; @@ -10,14 +11,18 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; +import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.Node; -/** Represents all tuple fields used in nested function. */ +/** + * Represents all tuple fields used in nested function. + */ @RequiredArgsConstructor @EqualsAndHashCode(callSuper = false) public class NestedAllTupleFields extends UnresolvedExpression { - @Getter private final String path; + @Getter + private final String path; @Override public List getChild() { diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Not.java b/core/src/main/java/org/opensearch/sql/ast/expression/Not.java index 423cb088ef..2926c7e5cd 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Not.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Not.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; @@ -13,7 +14,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Expression node of the logic NOT. */ +/** + * Expression node of the logic NOT. + */ @Getter @ToString @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Or.java b/core/src/main/java/org/opensearch/sql/ast/expression/Or.java index cc59170d31..b0dabb6e4e 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Or.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Or.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; @@ -13,7 +14,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Expression node of the logic OR. */ +/** + * Expression node of the logic OR. + */ @Getter @ToString @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/ParseMethod.java b/core/src/main/java/org/opensearch/sql/ast/expression/ParseMethod.java index 7a2587c5f0..83a46323e6 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/ParseMethod.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/ParseMethod.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import lombok.Getter; @@ -14,5 +15,6 @@ public enum ParseMethod { GROK("grok"), PATTERNS("patterns"); - @Getter private final String name; + @Getter + private final String name; } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/QualifiedName.java b/core/src/main/java/org/opensearch/sql/ast/expression/QualifiedName.java index 36e046a45a..8b16119dc0 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/QualifiedName.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/QualifiedName.java @@ -82,14 +82,14 @@ public Optional first() { /** * Get rest parts of the qualified name. Assume that there must be remaining parts - * so caller is responsible for the check (first() or size() must be called first).
- * For example:
- * {@code
- *   QualifiedName name = ...
- *   Optional first = name.first();
- *   if (first.isPresent()) {
- *   name.rest() ...
- *   }
+ * so caller is responsible for the check (first() or size() must be called first). + * For example: + * {@code + * QualifiedName name = ... + * Optional first = name.first(); + * if (first.isPresent()) { + * name.rest() ... + * } * } * @return rest part(s) */ diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/RelevanceFieldList.java b/core/src/main/java/org/opensearch/sql/ast/expression/RelevanceFieldList.java index a9e26a611f..65fb74881c 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/RelevanceFieldList.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/RelevanceFieldList.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.List; @@ -12,11 +13,14 @@ import lombok.Getter; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Expression node that includes a list of RelevanceField nodes. */ +/** + * Expression node that includes a list of RelevanceField nodes. + */ @EqualsAndHashCode(callSuper = false) @AllArgsConstructor public class RelevanceFieldList extends UnresolvedExpression { - @Getter private java.util.Map fieldList; + @Getter + private java.util.Map fieldList; @Override public List getChild() { @@ -30,8 +34,10 @@ public R accept(AbstractNodeVisitor nodeVisitor, C context) { @Override public String toString() { - return fieldList.entrySet().stream() - .map(e -> String.format("\"%s\" ^ %s", e.getKey(), e.getValue())) - .collect(Collectors.joining(", ")); + return fieldList + .entrySet() + .stream() + .map(e -> String.format("\"%s\" ^ %s", e.getKey(), e.getValue())) + .collect(Collectors.joining(", ")); } } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/ScoreFunction.java b/core/src/main/java/org/opensearch/sql/ast/expression/ScoreFunction.java index 26d784dd8c..1b73f9bd95 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/ScoreFunction.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/ScoreFunction.java @@ -13,8 +13,8 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; /** - * Expression node of Score function. Score takes a relevance-search expression as an argument and - * returns it + * Expression node of Score function. + * Score takes a relevance-search expression as an argument and returns it */ @AllArgsConstructor @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Span.java b/core/src/main/java/org/opensearch/sql/ast/expression/Span.java index edd309b22d..e57205c19c 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Span.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Span.java @@ -13,7 +13,10 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Span expression node. Params include field expression and the span value. */ +/** + * Span expression node. + * Params include field expression and the span value. + */ @Getter @EqualsAndHashCode(callSuper = false) @RequiredArgsConstructor @@ -32,4 +35,5 @@ public List getChild() { public R accept(AbstractNodeVisitor nodeVisitor, C context) { return nodeVisitor.visitSpan(this, context); } + } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/SpanUnit.java b/core/src/main/java/org/opensearch/sql/ast/expression/SpanUnit.java index 5252781edb..341d8084d0 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/SpanUnit.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/SpanUnit.java @@ -42,7 +42,9 @@ public enum SpanUnit { SPAN_UNITS = builder.add(SpanUnit.values()).build(); } - /** Util method to get span unit given the unit name. */ + /** + * Util method to get span unit given the unit name. + */ public static SpanUnit of(String unit) { switch (unit) { case "": @@ -53,13 +55,14 @@ public static SpanUnit of(String unit) { return m; default: return SPAN_UNITS.stream() - .filter(v -> unit.equalsIgnoreCase(v.name())) - .findFirst() - .orElse(UNKNOWN); + .filter(v -> unit.equalsIgnoreCase(v.name())) + .findFirst() + .orElse(UNKNOWN); } } public static String getName(SpanUnit unit) { return unit.name; } + } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedArgument.java b/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedArgument.java index 2c6eee46e9..e4def038ed 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedArgument.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedArgument.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; @@ -12,7 +13,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Argument. */ +/** + * Argument. + */ @Getter @ToString @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedAttribute.java b/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedAttribute.java index e1754cbf76..f4bc88853f 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedAttribute.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedAttribute.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import com.google.common.collect.ImmutableList; @@ -14,8 +15,9 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; /** - * Expression node, representing the syntax that is not resolved to any other expression nodes yet - * but non-negligible This expression is often created as the index name, field name etc. + * Expression node, representing the syntax that is not resolved to + * any other expression nodes yet but non-negligible + * This expression is often created as the index name, field name etc. */ @ToString @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedExpression.java b/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedExpression.java index 9b2d530b7f..ee3922f797 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedExpression.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/UnresolvedExpression.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import lombok.EqualsAndHashCode; diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/When.java b/core/src/main/java/org/opensearch/sql/ast/expression/When.java index db747592e5..a52870b408 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/When.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/When.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import com.google.common.collect.ImmutableList; @@ -14,17 +15,23 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.Node; -/** AST node that represents WHEN clause. */ +/** + * AST node that represents WHEN clause. + */ @EqualsAndHashCode(callSuper = false) @Getter @RequiredArgsConstructor @ToString public class When extends UnresolvedExpression { - /** WHEN condition, either a search condition or compare value if case value present. */ + /** + * WHEN condition, either a search condition or compare value if case value present. + */ private final UnresolvedExpression condition; - /** Result to return if condition matched. */ + /** + * Result to return if condition matched. + */ private final UnresolvedExpression result; @Override @@ -36,4 +43,5 @@ public List getChild() { public T accept(AbstractNodeVisitor nodeVisitor, C context) { return nodeVisitor.visitWhen(this, context); } + } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/WindowFunction.java b/core/src/main/java/org/opensearch/sql/ast/expression/WindowFunction.java index 47f5265765..9a7535e1fe 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/WindowFunction.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/WindowFunction.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import com.google.common.collect.ImmutableList; @@ -41,4 +42,5 @@ public List getChild() { public T accept(AbstractNodeVisitor nodeVisitor, C context) { return nodeVisitor.visitWindowFunction(this, context); } + } diff --git a/core/src/main/java/org/opensearch/sql/ast/expression/Xor.java b/core/src/main/java/org/opensearch/sql/ast/expression/Xor.java index 40db015fd7..731feccd33 100644 --- a/core/src/main/java/org/opensearch/sql/ast/expression/Xor.java +++ b/core/src/main/java/org/opensearch/sql/ast/expression/Xor.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.expression; import java.util.Arrays; @@ -13,7 +14,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Expression node of the logic XOR. */ +/** + * Expression node of the logic XOR. + */ @Getter @ToString @EqualsAndHashCode(callSuper = false) diff --git a/core/src/main/java/org/opensearch/sql/ast/statement/Explain.java b/core/src/main/java/org/opensearch/sql/ast/statement/Explain.java index 5ee260c130..1e364d69fd 100644 --- a/core/src/main/java/org/opensearch/sql/ast/statement/Explain.java +++ b/core/src/main/java/org/opensearch/sql/ast/statement/Explain.java @@ -12,7 +12,9 @@ import lombok.EqualsAndHashCode; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Explain Statement. */ +/** + * Explain Statement. + */ @Data @EqualsAndHashCode(callSuper = false) public class Explain extends Statement { diff --git a/core/src/main/java/org/opensearch/sql/ast/statement/Query.java b/core/src/main/java/org/opensearch/sql/ast/statement/Query.java index 6366451b72..82efdde4dd 100644 --- a/core/src/main/java/org/opensearch/sql/ast/statement/Query.java +++ b/core/src/main/java/org/opensearch/sql/ast/statement/Query.java @@ -16,7 +16,9 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.tree.UnresolvedPlan; -/** Query Statement. */ +/** + * Query Statement. + */ @Getter @Setter @ToString diff --git a/core/src/main/java/org/opensearch/sql/ast/statement/Statement.java b/core/src/main/java/org/opensearch/sql/ast/statement/Statement.java index d90071a0ca..e32a8dbfd8 100644 --- a/core/src/main/java/org/opensearch/sql/ast/statement/Statement.java +++ b/core/src/main/java/org/opensearch/sql/ast/statement/Statement.java @@ -11,7 +11,9 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.Node; -/** Statement is the high interface of core engine. */ +/** + * Statement is the high interface of core engine. + */ public abstract class Statement extends Node { @Override public R accept(AbstractNodeVisitor visitor, C context) { diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/AD.java b/core/src/main/java/org/opensearch/sql/ast/tree/AD.java index 0e1cc33db9..e9aee25c23 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/AD.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/AD.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Aggregation.java b/core/src/main/java/org/opensearch/sql/ast/tree/Aggregation.java index f098d0ec53..e9fa26e981 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Aggregation.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Aggregation.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -16,7 +17,9 @@ import org.opensearch.sql.ast.expression.Argument; import org.opensearch.sql.ast.expression.UnresolvedExpression; -/** Logical plan node of Aggregation, the interface for building aggregation actions in queries. */ +/** + * Logical plan node of Aggregation, the interface for building aggregation actions in queries. + */ @Getter @Setter @ToString @@ -29,21 +32,23 @@ public class Aggregation extends UnresolvedPlan { private List argExprList; private UnresolvedPlan child; - /** Aggregation Constructor without span and argument. */ - public Aggregation( - List aggExprList, - List sortExprList, - List groupExprList) { + /** + * Aggregation Constructor without span and argument. + */ + public Aggregation(List aggExprList, + List sortExprList, + List groupExprList) { this(aggExprList, sortExprList, groupExprList, null, Collections.emptyList()); } - /** Aggregation Constructor. */ - public Aggregation( - List aggExprList, - List sortExprList, - List groupExprList, - UnresolvedExpression span, - List argExprList) { + /** + * Aggregation Constructor. + */ + public Aggregation(List aggExprList, + List sortExprList, + List groupExprList, + UnresolvedExpression span, + List argExprList) { this.aggExprList = aggExprList; this.sortExprList = sortExprList; this.groupExprList = groupExprList; diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/CloseCursor.java b/core/src/main/java/org/opensearch/sql/ast/tree/CloseCursor.java index 832b79d34a..cf82c2b070 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/CloseCursor.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/CloseCursor.java @@ -9,10 +9,15 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.Node; -/** AST node to represent close cursor operation. Actually a wrapper to the AST. */ +/** + * AST node to represent close cursor operation. + * Actually a wrapper to the AST. + */ public class CloseCursor extends UnresolvedPlan { - /** An instance of {@link FetchCursor}. */ + /** + * An instance of {@link FetchCursor}. + */ private UnresolvedPlan cursor; @Override diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Dedupe.java b/core/src/main/java/org/opensearch/sql/ast/tree/Dedupe.java index 3173f42f9c..6514d65a04 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Dedupe.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Dedupe.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -17,7 +18,9 @@ import org.opensearch.sql.ast.expression.Argument; import org.opensearch.sql.ast.expression.Field; -/** AST node represent Dedupe operation. */ +/** + * AST node represent Dedupe operation. + */ @Getter @Setter @ToString diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Eval.java b/core/src/main/java/org/opensearch/sql/ast/tree/Eval.java index ecceabd757..184f2ac497 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Eval.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Eval.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -15,7 +16,9 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.expression.Let; -/** AST node represent Eval operation. */ +/** + * AST node represent Eval operation. + */ @Getter @Setter @ToString diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/FetchCursor.java b/core/src/main/java/org/opensearch/sql/ast/tree/FetchCursor.java index e34127c9d3..aa327c295b 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/FetchCursor.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/FetchCursor.java @@ -10,11 +10,15 @@ import lombok.RequiredArgsConstructor; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** An unresolved plan that represents fetching the next batch in paginationed plan. */ +/** + * An unresolved plan that represents fetching the next + * batch in paginationed plan. + */ @RequiredArgsConstructor @EqualsAndHashCode(callSuper = false) public class FetchCursor extends UnresolvedPlan { - @Getter final String cursor; + @Getter + final String cursor; @Override public T accept(AbstractNodeVisitor nodeVisitor, C context) { diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Filter.java b/core/src/main/java/org/opensearch/sql/ast/tree/Filter.java index 6c57275db9..8128078930 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Filter.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Filter.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -13,7 +14,9 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.expression.UnresolvedExpression; -/** Logical plan node of Filter, the interface for building filters in queries. */ +/** + * Logical plan node of Filter, the interface for building filters in queries. + */ @ToString @EqualsAndHashCode(callSuper = false) @Getter diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Head.java b/core/src/main/java/org/opensearch/sql/ast/tree/Head.java index bf6b2caed1..8590c212ad 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Head.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Head.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -15,7 +16,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** AST node represent Head operation. */ +/** + * AST node represent Head operation. + */ @Getter @Setter @ToString diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Kmeans.java b/core/src/main/java/org/opensearch/sql/ast/tree/Kmeans.java index ed03efed8a..5d2e32c28b 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Kmeans.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Kmeans.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Limit.java b/core/src/main/java/org/opensearch/sql/ast/tree/Limit.java index 9290776172..f9b8a8feab 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Limit.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Limit.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -37,4 +38,5 @@ public List getChild() { public T accept(AbstractNodeVisitor visitor, C context) { return visitor.visitLimit(this, context); } + } diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/ML.java b/core/src/main/java/org/opensearch/sql/ast/tree/ML.java index 320fb2bcf7..2f83a993b7 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/ML.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/ML.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import static org.opensearch.sql.utils.MLCommonsConstants.ACTION; @@ -65,7 +66,7 @@ public List getChild() { } private String getAction() { - return (String) arguments.get(ACTION).getValue(); + return (String) arguments.get(ACTION).getValue(); } /** @@ -84,7 +85,7 @@ public Map getOutputSchema(TypeEnvironment env) { return getPredictOutputSchema(); default: throw new IllegalArgumentException( - "Action error. Please indicate train, predict or trainandpredict."); + "Action error. Please indicate train, predict or trainandpredict."); } } @@ -121,8 +122,8 @@ public Map getPredictOutputSchema() { * @return the schema */ public Map getTrainOutputSchema() { - boolean isAsync = - arguments.containsKey(ASYNC) ? (boolean) arguments.get(ASYNC).getValue() : false; + boolean isAsync = arguments.containsKey(ASYNC) + ? (boolean) arguments.get(ASYNC).getValue() : false; Map res = new HashMap<>(Map.of(STATUS, ExprCoreType.STRING)); if (isAsync) { res.put(TASKID, ExprCoreType.STRING); diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Paginate.java b/core/src/main/java/org/opensearch/sql/ast/tree/Paginate.java index 69b11600c9..55e0e8c7a6 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Paginate.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Paginate.java @@ -13,12 +13,16 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.Node; -/** AST node to represent pagination operation. Actually a wrapper to the AST. */ +/** + * AST node to represent pagination operation. + * Actually a wrapper to the AST. + */ @RequiredArgsConstructor @EqualsAndHashCode(callSuper = false) @ToString public class Paginate extends UnresolvedPlan { - @Getter private final int pageSize; + @Getter + private final int pageSize; private UnresolvedPlan child; public Paginate(int pageSize, UnresolvedPlan child) { diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Parse.java b/core/src/main/java/org/opensearch/sql/ast/tree/Parse.java index e91c4a68ff..02a69c93af 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Parse.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Parse.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -19,7 +20,9 @@ import org.opensearch.sql.ast.expression.ParseMethod; import org.opensearch.sql.ast.expression.UnresolvedExpression; -/** AST node represent Parse with regex operation. */ +/** + * AST node represent Parse with regex operation. + */ @Getter @Setter @ToString @@ -27,19 +30,29 @@ @RequiredArgsConstructor @AllArgsConstructor public class Parse extends UnresolvedPlan { - /** Method used to parse a field. */ + /** + * Method used to parse a field. + */ private final ParseMethod parseMethod; - /** Field. */ + /** + * Field. + */ private final UnresolvedExpression sourceField; - /** Pattern. */ + /** + * Pattern. + */ private final Literal pattern; - /** Optional arguments. */ + /** + * Optional arguments. + */ private final Map arguments; - /** Child Plan. */ + /** + * Child Plan. + */ private UnresolvedPlan child; @Override diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Project.java b/core/src/main/java/org/opensearch/sql/ast/tree/Project.java index cffb4dfdce..33c7128855 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Project.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Project.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -16,12 +17,15 @@ import org.opensearch.sql.ast.expression.Argument; import org.opensearch.sql.ast.expression.UnresolvedExpression; -/** Logical plan node of Project, the interface for building the list of searching fields. */ +/** + * Logical plan node of Project, the interface for building the list of searching fields. + */ @ToString @Getter @EqualsAndHashCode(callSuper = false) public class Project extends UnresolvedPlan { - @Setter private List projectList; + @Setter + private List projectList; private List argExprList; private UnresolvedPlan child; @@ -39,7 +43,9 @@ public boolean hasArgument() { return !argExprList.isEmpty(); } - /** The Project could been used to exclude fields from the source. */ + /** + * The Project could been used to exclude fields from the source. + */ public boolean isExcluded() { if (hasArgument()) { Argument argument = argExprList.get(0); diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/RareTopN.java b/core/src/main/java/org/opensearch/sql/ast/tree/RareTopN.java index 2cbe170541..c884afd86a 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/RareTopN.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/RareTopN.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import java.util.Collections; @@ -18,7 +19,9 @@ import org.opensearch.sql.ast.expression.Field; import org.opensearch.sql.ast.expression.UnresolvedExpression; -/** AST node represent RareTopN operation. */ +/** + * AST node represent RareTopN operation. + */ @Getter @Setter @ToString @@ -54,3 +57,4 @@ public enum CommandType { RARE } } + diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Relation.java b/core/src/main/java/org/opensearch/sql/ast/tree/Relation.java index ec5264a86b..71eb014cd9 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Relation.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Relation.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -17,7 +18,9 @@ import org.opensearch.sql.ast.expression.QualifiedName; import org.opensearch.sql.ast.expression.UnresolvedExpression; -/** Logical plan node of Relation, the interface for building the searching sources. */ +/** + * Logical plan node of Relation, the interface for building the searching sources. + */ @AllArgsConstructor @ToString @EqualsAndHashCode(callSuper = false) @@ -36,7 +39,9 @@ public Relation(UnresolvedExpression tableName, String alias) { this.alias = alias; } - /** Optional alias name for the relation. */ + /** + * Optional alias name for the relation. + */ private String alias; /** @@ -67,9 +72,9 @@ public String getAlias() { } /** - * Get Qualified name preservs parts of the user given identifiers. This can later be utilized to - * determine DataSource,Schema and Table Name during Analyzer stage. So Passing QualifiedName - * directly to Analyzer Stage. + * Get Qualified name preservs parts of the user given identifiers. + * This can later be utilized to determine DataSource,Schema and Table Name during + * Analyzer stage. So Passing QualifiedName directly to Analyzer Stage. * * @return TableQualifiedName. */ @@ -77,8 +82,7 @@ public QualifiedName getTableQualifiedName() { if (tableName.size() == 1) { return (QualifiedName) tableName.get(0); } else { - return new QualifiedName( - tableName.stream() + return new QualifiedName(tableName.stream() .map(UnresolvedExpression::toString) .collect(Collectors.joining(COMMA))); } diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/RelationSubquery.java b/core/src/main/java/org/opensearch/sql/ast/tree/RelationSubquery.java index 5ab4d71dd9..89122bea7f 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/RelationSubquery.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/RelationSubquery.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -13,7 +14,9 @@ import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; -/** Logical plan node of RelationSubquery. */ +/** + * Logical plan node of RelationSubquery. + */ @AllArgsConstructor @EqualsAndHashCode(callSuper = false) @RequiredArgsConstructor @@ -22,7 +25,9 @@ public class RelationSubquery extends UnresolvedPlan { private UnresolvedPlan query; private String alias; - /** Take subquery alias as table name. */ + /** + * Take subquery alias as table name. + */ public String getAliasAsTableName() { return alias; } diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Rename.java b/core/src/main/java/org/opensearch/sql/ast/tree/Rename.java index e6f760aca0..69700c871c 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Rename.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Rename.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Sort.java b/core/src/main/java/org/opensearch/sql/ast/tree/Sort.java index 073cb7aa1b..5fb4139bea 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Sort.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Sort.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import static org.opensearch.sql.ast.tree.Sort.NullOrder.NULL_FIRST; @@ -21,7 +22,9 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.expression.Field; -/** AST node for Sort {@link Sort#sortList} represent a list of sort expression and sort options. */ +/** + * AST node for Sort {@link Sort#sortList} represent a list of sort expression and sort options. + */ @ToString @EqualsAndHashCode(callSuper = false) @Getter @@ -47,14 +50,19 @@ public T accept(AbstractNodeVisitor nodeVisitor, C context) { return nodeVisitor.visitSort(this, context); } - /** Sort Options. */ + /** + * Sort Options. + */ @Data public static class SortOption { - /** Default ascending sort option, null first. */ + /** + * Default ascending sort option, null first. + */ public static SortOption DEFAULT_ASC = new SortOption(ASC, NULL_FIRST); - - /** Default descending sort option, null last. */ + /** + * Default descending sort option, null last. + */ public static SortOption DEFAULT_DESC = new SortOption(DESC, NULL_LAST); private final SortOrder sortOrder; diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/TableFunction.java b/core/src/main/java/org/opensearch/sql/ast/tree/TableFunction.java index 711a8a0ec5..064cbf24fe 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/TableFunction.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/TableFunction.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -10,12 +11,16 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; +import lombok.Setter; import lombok.ToString; import org.opensearch.sql.ast.AbstractNodeVisitor; +import org.opensearch.sql.ast.expression.Let; import org.opensearch.sql.ast.expression.QualifiedName; import org.opensearch.sql.ast.expression.UnresolvedExpression; -/** ASTNode for Table Function. */ +/** + * ASTNode for Table Function. + */ @ToString @EqualsAndHashCode(callSuper = false) @RequiredArgsConstructor @@ -23,7 +28,8 @@ public class TableFunction extends UnresolvedPlan { private final UnresolvedExpression functionName; - @Getter private final List arguments; + @Getter + private final List arguments; public QualifiedName getFunctionName() { return (QualifiedName) functionName; diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/UnresolvedPlan.java b/core/src/main/java/org/opensearch/sql/ast/tree/UnresolvedPlan.java index 3074303b0d..672a4602ed 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/UnresolvedPlan.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/UnresolvedPlan.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import lombok.EqualsAndHashCode; @@ -10,7 +11,9 @@ import org.opensearch.sql.ast.AbstractNodeVisitor; import org.opensearch.sql.ast.Node; -/** Abstract unresolved plan. */ +/** + * Abstract unresolved plan. + */ @EqualsAndHashCode(callSuper = false) @ToString public abstract class UnresolvedPlan extends Node { diff --git a/core/src/main/java/org/opensearch/sql/ast/tree/Values.java b/core/src/main/java/org/opensearch/sql/ast/tree/Values.java index 65d7e8d7cb..5a662912f9 100644 --- a/core/src/main/java/org/opensearch/sql/ast/tree/Values.java +++ b/core/src/main/java/org/opensearch/sql/ast/tree/Values.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ + package org.opensearch.sql.ast.tree; import com.google.common.collect.ImmutableList; @@ -15,7 +16,9 @@ import org.opensearch.sql.ast.Node; import org.opensearch.sql.ast.expression.Literal; -/** AST node class for a sequence of literal values. */ +/** + * AST node class for a sequence of literal values. + */ @ToString @Getter @EqualsAndHashCode(callSuper = false) @@ -38,4 +41,5 @@ public T accept(AbstractNodeVisitor nodeVisitor, C context) { public List getChild() { return ImmutableList.of(); } + }