1 | /* | |
2 | * Copyright OpenSearch Contributors | |
3 | * SPDX-License-Identifier: Apache-2.0 | |
4 | */ | |
5 | ||
6 | ||
7 | package org.opensearch.sql.ast.dsl; | |
8 | ||
9 | import java.util.Arrays; | |
10 | import java.util.List; | |
11 | import java.util.stream.Collectors; | |
12 | import lombok.experimental.UtilityClass; | |
13 | import org.apache.commons.lang3.tuple.Pair; | |
14 | import org.opensearch.sql.ast.expression.AggregateFunction; | |
15 | import org.opensearch.sql.ast.expression.Alias; | |
16 | import org.opensearch.sql.ast.expression.AllFields; | |
17 | import org.opensearch.sql.ast.expression.And; | |
18 | import org.opensearch.sql.ast.expression.Argument; | |
19 | import org.opensearch.sql.ast.expression.Case; | |
20 | import org.opensearch.sql.ast.expression.Cast; | |
21 | import org.opensearch.sql.ast.expression.Compare; | |
22 | import org.opensearch.sql.ast.expression.ConstantFunction; | |
23 | import org.opensearch.sql.ast.expression.DataType; | |
24 | import org.opensearch.sql.ast.expression.EqualTo; | |
25 | import org.opensearch.sql.ast.expression.Field; | |
26 | import org.opensearch.sql.ast.expression.Function; | |
27 | import org.opensearch.sql.ast.expression.HighlightFunction; | |
28 | import org.opensearch.sql.ast.expression.In; | |
29 | import org.opensearch.sql.ast.expression.Interval; | |
30 | import org.opensearch.sql.ast.expression.Let; | |
31 | import org.opensearch.sql.ast.expression.Literal; | |
32 | import org.opensearch.sql.ast.expression.Map; | |
33 | import org.opensearch.sql.ast.expression.Not; | |
34 | import org.opensearch.sql.ast.expression.Or; | |
35 | import org.opensearch.sql.ast.expression.ParseMethod; | |
36 | import org.opensearch.sql.ast.expression.QualifiedName; | |
37 | import org.opensearch.sql.ast.expression.Span; | |
38 | import org.opensearch.sql.ast.expression.SpanUnit; | |
39 | import org.opensearch.sql.ast.expression.UnresolvedArgument; | |
40 | import org.opensearch.sql.ast.expression.UnresolvedAttribute; | |
41 | import org.opensearch.sql.ast.expression.UnresolvedExpression; | |
42 | import org.opensearch.sql.ast.expression.When; | |
43 | import org.opensearch.sql.ast.expression.WindowFunction; | |
44 | import org.opensearch.sql.ast.expression.Xor; | |
45 | import org.opensearch.sql.ast.tree.Aggregation; | |
46 | import org.opensearch.sql.ast.tree.Dedupe; | |
47 | import org.opensearch.sql.ast.tree.Eval; | |
48 | import org.opensearch.sql.ast.tree.Filter; | |
49 | import org.opensearch.sql.ast.tree.Head; | |
50 | import org.opensearch.sql.ast.tree.Limit; | |
51 | import org.opensearch.sql.ast.tree.Parse; | |
52 | import org.opensearch.sql.ast.tree.Project; | |
53 | import org.opensearch.sql.ast.tree.RareTopN; | |
54 | import org.opensearch.sql.ast.tree.RareTopN.CommandType; | |
55 | import org.opensearch.sql.ast.tree.Relation; | |
56 | import org.opensearch.sql.ast.tree.RelationSubquery; | |
57 | import org.opensearch.sql.ast.tree.Rename; | |
58 | import org.opensearch.sql.ast.tree.Sort; | |
59 | import org.opensearch.sql.ast.tree.Sort.SortOption; | |
60 | import org.opensearch.sql.ast.tree.TableFunction; | |
61 | import org.opensearch.sql.ast.tree.UnresolvedPlan; | |
62 | import org.opensearch.sql.ast.tree.Values; | |
63 | ||
64 | /** | |
65 | * Class of static methods to create specific node instances. | |
66 | */ | |
67 | @UtilityClass | |
68 | public class AstDSL { | |
69 | ||
70 | public static UnresolvedPlan filter(UnresolvedPlan input, UnresolvedExpression expression) { | |
71 |
1
1. filter : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::filter → KILLED |
return new Filter(expression).attach(input); |
72 | } | |
73 | ||
74 | public UnresolvedPlan relation(String tableName) { | |
75 |
1
1. relation : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::relation → KILLED |
return new Relation(qualifiedName(tableName)); |
76 | } | |
77 | ||
78 | public UnresolvedPlan relation(List<String> tableNames) { | |
79 |
1
1. relation : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::relation → KILLED |
return new Relation( |
80 |
1
1. lambda$relation$0 : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::lambda$relation$0 → KILLED |
tableNames.stream().map(AstDSL::qualifiedName).collect(Collectors.toList())); |
81 | } | |
82 | ||
83 | public UnresolvedPlan relation(QualifiedName tableName) { | |
84 |
1
1. relation : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::relation → KILLED |
return new Relation(tableName); |
85 | } | |
86 | ||
87 | public UnresolvedPlan relation(String tableName, String alias) { | |
88 |
1
1. relation : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::relation → KILLED |
return new Relation(qualifiedName(tableName), alias); |
89 | } | |
90 | ||
91 | public UnresolvedPlan tableFunction(List<String> functionName, UnresolvedExpression... args) { | |
92 |
1
1. tableFunction : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::tableFunction → KILLED |
return new TableFunction(new QualifiedName(functionName), Arrays.asList(args)); |
93 | } | |
94 | ||
95 | public static UnresolvedPlan project(UnresolvedPlan input, UnresolvedExpression... projectList) { | |
96 |
1
1. project : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::project → KILLED |
return new Project(Arrays.asList(projectList)).attach(input); |
97 | } | |
98 | ||
99 | public static Eval eval(UnresolvedPlan input, Let... projectList) { | |
100 |
1
1. eval : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::eval → KILLED |
return new Eval(Arrays.asList(projectList)).attach(input); |
101 | } | |
102 | ||
103 | public static UnresolvedPlan projectWithArg( | |
104 | UnresolvedPlan input, List<Argument> argList, UnresolvedExpression... projectList) { | |
105 |
1
1. projectWithArg : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::projectWithArg → KILLED |
return new Project(Arrays.asList(projectList), argList).attach(input); |
106 | } | |
107 | ||
108 | public static UnresolvedPlan agg( | |
109 | UnresolvedPlan input, | |
110 | List<UnresolvedExpression> aggList, | |
111 | List<UnresolvedExpression> sortList, | |
112 | List<UnresolvedExpression> groupList, | |
113 | List<Argument> argList) { | |
114 |
1
1. agg : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::agg → KILLED |
return new Aggregation(aggList, sortList, groupList, null, argList).attach(input); |
115 | } | |
116 | ||
117 | public static UnresolvedPlan agg( | |
118 | UnresolvedPlan input, | |
119 | List<UnresolvedExpression> aggList, | |
120 | List<UnresolvedExpression> sortList, | |
121 | List<UnresolvedExpression> groupList, | |
122 | UnresolvedExpression span, | |
123 | List<Argument> argList) { | |
124 |
1
1. agg : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::agg → KILLED |
return new Aggregation(aggList, sortList, groupList, span, argList).attach(input); |
125 | } | |
126 | ||
127 | public static UnresolvedPlan rename(UnresolvedPlan input, Map... maps) { | |
128 |
1
1. rename : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::rename → KILLED |
return new Rename(Arrays.asList(maps), input); |
129 | } | |
130 | ||
131 | /** | |
132 | * Initialize Values node by rows of literals. | |
133 | * @param values rows in which each row is a list of literal values | |
134 | * @return Values node | |
135 | */ | |
136 | @SafeVarargs | |
137 | public UnresolvedPlan values(List<Literal>... values) { | |
138 |
1
1. values : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::values → KILLED |
return new Values(Arrays.asList(values)); |
139 | } | |
140 | ||
141 | public static QualifiedName qualifiedName(String... parts) { | |
142 |
1
1. qualifiedName : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::qualifiedName → KILLED |
return new QualifiedName(Arrays.asList(parts)); |
143 | } | |
144 | ||
145 | public static UnresolvedExpression equalTo( | |
146 | UnresolvedExpression left, UnresolvedExpression right) { | |
147 |
1
1. equalTo : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::equalTo → KILLED |
return new EqualTo(left, right); |
148 | } | |
149 | ||
150 | public static UnresolvedExpression unresolvedAttr(String attr) { | |
151 |
1
1. unresolvedAttr : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::unresolvedAttr → KILLED |
return new UnresolvedAttribute(attr); |
152 | } | |
153 | ||
154 | public static UnresolvedPlan relationSubquery(UnresolvedPlan subquery, String subqueryAlias) { | |
155 |
1
1. relationSubquery : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::relationSubquery → KILLED |
return new RelationSubquery(subquery, subqueryAlias); |
156 | } | |
157 | ||
158 | private static Literal literal(Object value, DataType type) { | |
159 |
1
1. literal : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::literal → KILLED |
return new Literal(value, type); |
160 | } | |
161 | ||
162 | public static Let let(Field var, UnresolvedExpression expression) { | |
163 |
1
1. let : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::let → KILLED |
return new Let(var, expression); |
164 | } | |
165 | ||
166 | public static Literal intLiteral(Integer value) { | |
167 |
1
1. intLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::intLiteral → KILLED |
return literal(value, DataType.INTEGER); |
168 | } | |
169 | ||
170 | public static Literal longLiteral(Long value) { | |
171 |
1
1. longLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::longLiteral → NO_COVERAGE |
return literal(value, DataType.LONG); |
172 | } | |
173 | ||
174 | public static Literal shortLiteral(Short value) { | |
175 |
1
1. shortLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::shortLiteral → NO_COVERAGE |
return literal(value, DataType.SHORT); |
176 | } | |
177 | ||
178 | public static Literal floatLiteral(Float value) { | |
179 |
1
1. floatLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::floatLiteral → KILLED |
return literal(value, DataType.FLOAT); |
180 | } | |
181 | ||
182 | public static Literal dateLiteral(String value) { | |
183 |
1
1. dateLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::dateLiteral → NO_COVERAGE |
return literal(value, DataType.DATE); |
184 | } | |
185 | ||
186 | public static Literal timeLiteral(String value) { | |
187 |
1
1. timeLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::timeLiteral → NO_COVERAGE |
return literal(value, DataType.TIME); |
188 | } | |
189 | ||
190 | public static Literal timestampLiteral(String value) { | |
191 |
1
1. timestampLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::timestampLiteral → NO_COVERAGE |
return literal(value, DataType.TIMESTAMP); |
192 | } | |
193 | ||
194 | public static Literal doubleLiteral(Double value) { | |
195 |
1
1. doubleLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::doubleLiteral → NO_COVERAGE |
return literal(value, DataType.DOUBLE); |
196 | } | |
197 | ||
198 | public static Literal stringLiteral(String value) { | |
199 |
1
1. stringLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::stringLiteral → KILLED |
return literal(value, DataType.STRING); |
200 | } | |
201 | ||
202 | public static Literal booleanLiteral(Boolean value) { | |
203 |
1
1. booleanLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::booleanLiteral → KILLED |
return literal(value, DataType.BOOLEAN); |
204 | } | |
205 | ||
206 | public static Interval intervalLiteral(Object value, DataType type, String unit) { | |
207 |
1
1. intervalLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::intervalLiteral → KILLED |
return new Interval(literal(value, type), unit); |
208 | } | |
209 | ||
210 | public static Literal nullLiteral() { | |
211 |
1
1. nullLiteral : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::nullLiteral → KILLED |
return literal(null, DataType.NULL); |
212 | } | |
213 | ||
214 | public static Map map(String origin, String target) { | |
215 |
1
1. map : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::map → NO_COVERAGE |
return new Map(field(origin), field(target)); |
216 | } | |
217 | ||
218 | public static Map map(UnresolvedExpression origin, UnresolvedExpression target) { | |
219 |
1
1. map : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::map → KILLED |
return new Map(origin, target); |
220 | } | |
221 | ||
222 | public static UnresolvedExpression aggregate(String func, UnresolvedExpression field) { | |
223 |
1
1. aggregate : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::aggregate → KILLED |
return new AggregateFunction(func, field); |
224 | } | |
225 | ||
226 | public static UnresolvedExpression aggregate( | |
227 | String func, UnresolvedExpression field, UnresolvedExpression... args) { | |
228 |
1
1. aggregate : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::aggregate → KILLED |
return new AggregateFunction(func, field, Arrays.asList(args)); |
229 | } | |
230 | ||
231 | public static UnresolvedExpression filteredAggregate( | |
232 | String func, UnresolvedExpression field, UnresolvedExpression condition) { | |
233 |
1
1. filteredAggregate : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::filteredAggregate → KILLED |
return new AggregateFunction(func, field).condition(condition); |
234 | } | |
235 | ||
236 | public static UnresolvedExpression distinctAggregate(String func, UnresolvedExpression field) { | |
237 |
1
1. distinctAggregate : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::distinctAggregate → KILLED |
return new AggregateFunction(func, field, true); |
238 | } | |
239 | ||
240 | public static UnresolvedExpression filteredDistinctCount( | |
241 | String func, UnresolvedExpression field, UnresolvedExpression condition) { | |
242 |
1
1. filteredDistinctCount : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::filteredDistinctCount → KILLED |
return new AggregateFunction(func, field, true).condition(condition); |
243 | } | |
244 | ||
245 | public static Function function(String funcName, UnresolvedExpression... funcArgs) { | |
246 |
1
1. function : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::function → KILLED |
return new Function(funcName, Arrays.asList(funcArgs)); |
247 | } | |
248 | ||
249 | public static Function constantFunction(String funcName, UnresolvedExpression... funcArgs) { | |
250 |
1
1. constantFunction : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::constantFunction → KILLED |
return new ConstantFunction(funcName, Arrays.asList(funcArgs)); |
251 | } | |
252 | ||
253 | /** | |
254 | * CASE | |
255 | * WHEN search_condition THEN result_expr | |
256 | * [WHEN search_condition THEN result_expr] ... | |
257 | * [ELSE result_expr] | |
258 | * END | |
259 | */ | |
260 | public UnresolvedExpression caseWhen(UnresolvedExpression elseClause, | |
261 | When... whenClauses) { | |
262 |
1
1. caseWhen : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::caseWhen → KILLED |
return caseWhen(null, elseClause, whenClauses); |
263 | } | |
264 | ||
265 | /** | |
266 | * CASE case_value_expr | |
267 | * WHEN compare_expr THEN result_expr | |
268 | * [WHEN compare_expr THEN result_expr] ... | |
269 | * [ELSE result_expr] | |
270 | * END | |
271 | */ | |
272 | public UnresolvedExpression caseWhen(UnresolvedExpression caseValueExpr, | |
273 | UnresolvedExpression elseClause, | |
274 | When... whenClauses) { | |
275 |
1
1. caseWhen : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::caseWhen → KILLED |
return new Case(caseValueExpr, Arrays.asList(whenClauses), elseClause); |
276 | } | |
277 | ||
278 | public UnresolvedExpression cast(UnresolvedExpression expr, Literal type) { | |
279 |
1
1. cast : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::cast → KILLED |
return new Cast(expr, type); |
280 | } | |
281 | ||
282 | public When when(UnresolvedExpression condition, UnresolvedExpression result) { | |
283 |
1
1. when : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::when → KILLED |
return new When(condition, result); |
284 | } | |
285 | ||
286 | public UnresolvedExpression highlight(UnresolvedExpression fieldName, | |
287 | java.util.Map<String, Literal> arguments) { | |
288 |
1
1. highlight : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::highlight → NO_COVERAGE |
return new HighlightFunction(fieldName, arguments); |
289 | } | |
290 | ||
291 | public UnresolvedExpression window(UnresolvedExpression function, | |
292 | List<UnresolvedExpression> partitionByList, | |
293 | List<Pair<SortOption, UnresolvedExpression>> sortList) { | |
294 |
1
1. window : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::window → KILLED |
return new WindowFunction(function, partitionByList, sortList); |
295 | } | |
296 | ||
297 | public static UnresolvedExpression not(UnresolvedExpression expression) { | |
298 |
1
1. not : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::not → KILLED |
return new Not(expression); |
299 | } | |
300 | ||
301 | public static UnresolvedExpression or(UnresolvedExpression left, UnresolvedExpression right) { | |
302 |
1
1. or : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::or → KILLED |
return new Or(left, right); |
303 | } | |
304 | ||
305 | public static UnresolvedExpression and(UnresolvedExpression left, UnresolvedExpression right) { | |
306 |
1
1. and : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::and → KILLED |
return new And(left, right); |
307 | } | |
308 | ||
309 | public static UnresolvedExpression xor(UnresolvedExpression left, UnresolvedExpression right) { | |
310 |
1
1. xor : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::xor → KILLED |
return new Xor(left, right); |
311 | } | |
312 | ||
313 | public static UnresolvedExpression in( | |
314 | UnresolvedExpression field, UnresolvedExpression... valueList) { | |
315 |
1
1. in : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::in → KILLED |
return new In(field, Arrays.asList(valueList)); |
316 | } | |
317 | ||
318 | public static UnresolvedExpression in( | |
319 | UnresolvedExpression field, List<UnresolvedExpression> valueList) { | |
320 |
1
1. in : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::in → KILLED |
return new In(field, valueList); |
321 | } | |
322 | ||
323 | public static UnresolvedExpression compare( | |
324 | String operator, UnresolvedExpression left, UnresolvedExpression right) { | |
325 |
1
1. compare : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::compare → KILLED |
return new Compare(operator, left, right); |
326 | } | |
327 | ||
328 | public static Argument argument(String argName, Literal argValue) { | |
329 |
1
1. argument : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::argument → KILLED |
return new Argument(argName, argValue); |
330 | } | |
331 | ||
332 | public static UnresolvedArgument unresolvedArg(String argName, UnresolvedExpression argValue) { | |
333 |
1
1. unresolvedArg : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::unresolvedArg → KILLED |
return new UnresolvedArgument(argName, argValue); |
334 | } | |
335 | ||
336 | public AllFields allFields() { | |
337 |
1
1. allFields : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::allFields → KILLED |
return AllFields.of(); |
338 | } | |
339 | ||
340 | public Field field(UnresolvedExpression field) { | |
341 |
1
1. field : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::field → KILLED |
return new Field(field); |
342 | } | |
343 | ||
344 | public Field field(UnresolvedExpression field, Argument... fieldArgs) { | |
345 |
1
1. field : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::field → KILLED |
return field(field, Arrays.asList(fieldArgs)); |
346 | } | |
347 | ||
348 | public Field field(String field) { | |
349 |
1
1. field : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::field → KILLED |
return field(qualifiedName(field)); |
350 | } | |
351 | ||
352 | public Field field(String field, Argument... fieldArgs) { | |
353 |
1
1. field : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::field → NO_COVERAGE |
return field(field, Arrays.asList(fieldArgs)); |
354 | } | |
355 | ||
356 | public Field field(UnresolvedExpression field, List<Argument> fieldArgs) { | |
357 |
1
1. field : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::field → KILLED |
return new Field(field, fieldArgs); |
358 | } | |
359 | ||
360 | public Field field(String field, List<Argument> fieldArgs) { | |
361 |
1
1. field : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::field → KILLED |
return field(qualifiedName(field), fieldArgs); |
362 | } | |
363 | ||
364 | public Alias alias(String name, UnresolvedExpression expr) { | |
365 |
1
1. alias : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::alias → KILLED |
return new Alias(name, expr); |
366 | } | |
367 | ||
368 | public Alias alias(String name, UnresolvedExpression expr, String alias) { | |
369 |
1
1. alias : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::alias → KILLED |
return new Alias(name, expr, alias); |
370 | } | |
371 | ||
372 | public static List<UnresolvedExpression> exprList(UnresolvedExpression... exprList) { | |
373 |
1
1. exprList : replaced return value with Collections.emptyList for org/opensearch/sql/ast/dsl/AstDSL::exprList → KILLED |
return Arrays.asList(exprList); |
374 | } | |
375 | ||
376 | public static List<Argument> exprList(Argument... exprList) { | |
377 |
1
1. exprList : replaced return value with Collections.emptyList for org/opensearch/sql/ast/dsl/AstDSL::exprList → KILLED |
return Arrays.asList(exprList); |
378 | } | |
379 | ||
380 | public static List<UnresolvedArgument> unresolvedArgList(UnresolvedArgument... exprList) { | |
381 |
1
1. unresolvedArgList : replaced return value with Collections.emptyList for org/opensearch/sql/ast/dsl/AstDSL::unresolvedArgList → NO_COVERAGE |
return Arrays.asList(exprList); |
382 | } | |
383 | ||
384 | public static List<Argument> defaultFieldsArgs() { | |
385 |
1
1. defaultFieldsArgs : replaced return value with Collections.emptyList for org/opensearch/sql/ast/dsl/AstDSL::defaultFieldsArgs → SURVIVED |
return exprList(argument("exclude", booleanLiteral(false))); |
386 | } | |
387 | ||
388 | /** | |
389 | * Default Stats Command Args. | |
390 | */ | |
391 | public static List<Argument> defaultStatsArgs() { | |
392 |
1
1. defaultStatsArgs : replaced return value with Collections.emptyList for org/opensearch/sql/ast/dsl/AstDSL::defaultStatsArgs → SURVIVED |
return exprList( |
393 | argument("partitions", intLiteral(1)), | |
394 | argument("allnum", booleanLiteral(false)), | |
395 | argument("delim", stringLiteral(" ")), | |
396 | argument("dedupsplit", booleanLiteral(false))); | |
397 | } | |
398 | ||
399 | /** | |
400 | * Default Dedup Command Args. | |
401 | */ | |
402 | public static List<Argument> defaultDedupArgs() { | |
403 |
1
1. defaultDedupArgs : replaced return value with Collections.emptyList for org/opensearch/sql/ast/dsl/AstDSL::defaultDedupArgs → KILLED |
return exprList( |
404 | argument("number", intLiteral(1)), | |
405 | argument("keepempty", booleanLiteral(false)), | |
406 | argument("consecutive", booleanLiteral(false))); | |
407 | } | |
408 | ||
409 | public static List<Argument> sortOptions() { | |
410 |
1
1. sortOptions : replaced return value with Collections.emptyList for org/opensearch/sql/ast/dsl/AstDSL::sortOptions → NO_COVERAGE |
return exprList(argument("desc", booleanLiteral(false))); |
411 | } | |
412 | ||
413 | public static List<Argument> defaultSortFieldArgs() { | |
414 |
1
1. defaultSortFieldArgs : replaced return value with Collections.emptyList for org/opensearch/sql/ast/dsl/AstDSL::defaultSortFieldArgs → KILLED |
return exprList(argument("asc", booleanLiteral(true)), argument("type", nullLiteral())); |
415 | } | |
416 | ||
417 | public static Span span(UnresolvedExpression field, UnresolvedExpression value, SpanUnit unit) { | |
418 |
1
1. span : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::span → KILLED |
return new Span(field, value, unit); |
419 | } | |
420 | ||
421 | public static Sort sort(UnresolvedPlan input, Field... sorts) { | |
422 |
1
1. sort : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::sort → KILLED |
return new Sort(input, Arrays.asList(sorts)); |
423 | } | |
424 | ||
425 | public static Dedupe dedupe(UnresolvedPlan input, List<Argument> options, Field... fields) { | |
426 |
1
1. dedupe : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::dedupe → KILLED |
return new Dedupe(input, options, Arrays.asList(fields)); |
427 | } | |
428 | ||
429 | public static Head head(UnresolvedPlan input, Integer size, Integer from) { | |
430 |
1
1. head : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::head → KILLED |
return new Head(input, size, from); |
431 | } | |
432 | ||
433 | public static List<Argument> defaultTopArgs() { | |
434 |
1
1. defaultTopArgs : replaced return value with Collections.emptyList for org/opensearch/sql/ast/dsl/AstDSL::defaultTopArgs → NO_COVERAGE |
return exprList(argument("noOfResults", intLiteral(10))); |
435 | } | |
436 | ||
437 | public static RareTopN rareTopN(UnresolvedPlan input, CommandType commandType, | |
438 | List<Argument> noOfResults, List<UnresolvedExpression> groupList, | |
439 | Field... fields) { | |
440 |
1
1. rareTopN : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::rareTopN → KILLED |
return new RareTopN(input, commandType, noOfResults, Arrays.asList(fields), groupList) |
441 | .attach(input); | |
442 | } | |
443 | ||
444 | public static Limit limit(UnresolvedPlan input, Integer limit, Integer offset) { | |
445 |
1
1. limit : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::limit → KILLED |
return new Limit(limit, offset).attach(input); |
446 | } | |
447 | ||
448 | public static Parse parse(UnresolvedPlan input, ParseMethod parseMethod, | |
449 | UnresolvedExpression sourceField, | |
450 | Literal pattern, | |
451 | java.util.Map<String, Literal> arguments) { | |
452 |
1
1. parse : replaced return value with null for org/opensearch/sql/ast/dsl/AstDSL::parse → KILLED |
return new Parse(parseMethod, sourceField, pattern, arguments, input); |
453 | } | |
454 | ||
455 | } | |
Mutations | ||
71 |
1.1 |
|
75 |
1.1 |
|
79 |
1.1 |
|
80 |
1.1 |
|
84 |
1.1 |
|
88 |
1.1 |
|
92 |
1.1 |
|
96 |
1.1 |
|
100 |
1.1 |
|
105 |
1.1 |
|
114 |
1.1 |
|
124 |
1.1 |
|
128 |
1.1 |
|
138 |
1.1 |
|
142 |
1.1 |
|
147 |
1.1 |
|
151 |
1.1 |
|
155 |
1.1 |
|
159 |
1.1 |
|
163 |
1.1 |
|
167 |
1.1 |
|
171 |
1.1 |
|
175 |
1.1 |
|
179 |
1.1 |
|
183 |
1.1 |
|
187 |
1.1 |
|
191 |
1.1 |
|
195 |
1.1 |
|
199 |
1.1 |
|
203 |
1.1 |
|
207 |
1.1 |
|
211 |
1.1 |
|
215 |
1.1 |
|
219 |
1.1 |
|
223 |
1.1 |
|
228 |
1.1 |
|
233 |
1.1 |
|
237 |
1.1 |
|
242 |
1.1 |
|
246 |
1.1 |
|
250 |
1.1 |
|
262 |
1.1 |
|
275 |
1.1 |
|
279 |
1.1 |
|
283 |
1.1 |
|
288 |
1.1 |
|
294 |
1.1 |
|
298 |
1.1 |
|
302 |
1.1 |
|
306 |
1.1 |
|
310 |
1.1 |
|
315 |
1.1 |
|
320 |
1.1 |
|
325 |
1.1 |
|
329 |
1.1 |
|
333 |
1.1 |
|
337 |
1.1 |
|
341 |
1.1 |
|
345 |
1.1 |
|
349 |
1.1 |
|
353 |
1.1 |
|
357 |
1.1 |
|
361 |
1.1 |
|
365 |
1.1 |
|
369 |
1.1 |
|
373 |
1.1 |
|
377 |
1.1 |
|
381 |
1.1 |
|
385 |
1.1 |
|
392 |
1.1 |
|
403 |
1.1 |
|
410 |
1.1 |
|
414 |
1.1 |
|
418 |
1.1 |
|
422 |
1.1 |
|
426 |
1.1 |
|
430 |
1.1 |
|
434 |
1.1 |
|
440 |
1.1 |
|
445 |
1.1 |
|
452 |
1.1 |