Skip to content

Commit 7d55f5a

Browse files
authored
Adding pre tag to javadocs that need to maintain old formatting.
1 parent 90e44c4 commit 7d55f5a

File tree

4 files changed

+44
-17
lines changed

4 files changed

+44
-17
lines changed

core/src/main/java/org/opensearch/sql/analysis/ExpressionReferenceOptimizer.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@
2525
import org.opensearch.sql.planner.logical.LogicalWindow;
2626

2727
/**
28-
* The optimizer used to replace the expression referred in the SelectClause e.g. The query SELECT
29-
* abs(name), sum(age)-avg(age) FROM test GROUP BY abs(name). will be translated the AST
30-
* Project[abs(age), sub(sum(age), avg(age)) Agg(agg=[sum(age), avg(age)], group=[abs(age)]]
31-
* Relation The sum(age) and avg(age) in the Project could be replace by the analyzed reference, the
32-
* LogicalPlan should be LogicalProject[Ref("abs(age)"), sub(Ref("sum(age)"), Ref("avg(age)"))
33-
* LogicalAgg(agg=[sum(age), avg(age)], group=[abs(age)]] LogicalRelation
28+
* <pre>
29+
* The optimizer used to replace the expression referred in the SelectClause
30+
* e.g. The query SELECT abs(name), sum(age)-avg(age) FROM test GROUP BY abs(name).
31+
* will be translated the AST
32+
* Project[abs(age), sub(sum(age), avg(age))
33+
* Agg(agg=[sum(age), avg(age)], group=[abs(age)]]
34+
* Relation
35+
* The sum(age) and avg(age) in the Project could be replace by the analyzed reference, the
36+
* LogicalPlan should be
37+
* LogicalProject[Ref("abs(age)"), sub(Ref("sum(age)"), Ref("avg(age)"))
38+
* LogicalAgg(agg=[sum(age), avg(age)], group=[abs(age)]]
39+
* LogicalRelation
40+
* </pre>
3441
*/
3542
public class ExpressionReferenceOptimizer
3643
extends ExpressionNodeVisitor<Expression, AnalysisContext> {

core/src/main/java/org/opensearch/sql/analysis/SelectExpressionAnalyzer.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,18 @@ public List<NamedExpression> visitAlias(Alias node, AnalysisContext context) {
7070
}
7171

7272
/**
73-
* The Alias could be 1. SELECT name, AVG(age) FROM s BY name -> Project(Alias("name", expr),
74-
* Alias("AVG(age)", aggExpr)) Agg(Alias("AVG(age)", aggExpr)) 2. SELECT length(name), AVG(age)
75-
* FROM s BY length(name) Project(Alias("name", expr), Alias("AVG(age)", aggExpr))
76-
* Agg(Alias("AVG(age)", aggExpr)) 3. SELECT length(name) as l, AVG(age) FROM s BY l
77-
* Project(Alias("name", expr, l), Alias("AVG(age)", aggExpr)) Agg(Alias("AVG(age)", aggExpr),
78-
* Alias("length(name)", groupExpr))
73+
* <pre>
74+
* The Alias could be
75+
* 1. SELECT name, AVG(age) FROM s BY name ->
76+
* Project(Alias("name", expr), Alias("AVG(age)", aggExpr))
77+
* Agg(Alias("AVG(age)", aggExpr))
78+
* 2. SELECT length(name), AVG(age) FROM s BY length(name)
79+
* Project(Alias("name", expr), Alias("AVG(age)", aggExpr))
80+
* Agg(Alias("AVG(age)", aggExpr))
81+
* 3. SELECT length(name) as l, AVG(age) FROM s BY l
82+
* Project(Alias("name", expr, l), Alias("AVG(age)", aggExpr))
83+
* Agg(Alias("AVG(age)", aggExpr), Alias("length(name)", groupExpr))
84+
* </pre>
7985
*/
8086
private Expression referenceIfSymbolDefined(Alias expr, AnalysisContext context) {
8187
UnresolvedExpression delegatedExpr = expr.getDelegated();

core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,13 @@ public static Function function(String funcName, UnresolvedExpression... funcArg
247247
}
248248

249249
/**
250-
* CASE WHEN search_condition THEN result_expr [WHEN search_condition THEN result_expr] ... [ELSE
251-
* result_expr] END
250+
* <pre>
251+
* CASE
252+
* WHEN search_condition THEN result_expr
253+
* [WHEN search_condition THEN result_expr] ...
254+
* [ELSE result_expr]
255+
* END
256+
* </pre>
252257
*/
253258
public UnresolvedExpression caseWhen(UnresolvedExpression elseClause, When... whenClauses) {
254259
return caseWhen(null, elseClause, whenClauses);

core/src/main/java/org/opensearch/sql/data/type/WideningTypeRule.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,18 @@
1111
import org.opensearch.sql.exception.ExpressionEvaluationException;
1212

1313
/**
14-
* The definition of widening type rule for expression value. ExprType Widens to data types INTEGER
15-
* LONG, FLOAT, DOUBLE LONG FLOAT, DOUBLE FLOAT DOUBLE DOUBLE DOUBLE STRING STRING BOOLEAN BOOLEAN
16-
* ARRAY ARRAY STRUCT STRUCT
14+
* <pre>
15+
* The definition of widening type rule for expression value.
16+
* ExprType Widens to data types
17+
* INTEGER LONG, FLOAT, DOUBLE
18+
* LONG FLOAT, DOUBLE
19+
* FLOAT DOUBLE
20+
* DOUBLE DOUBLE
21+
* STRING STRING
22+
* BOOLEAN BOOLEAN
23+
* ARRAY ARRAY
24+
* STRUCT STRUCT
25+
* </pre>
1726
*/
1827
@UtilityClass
1928
public class WideningTypeRule {

0 commit comments

Comments
 (0)