Skip to content

Commit cbdc2ba

Browse files
committed
style(dqe): apply spotless formatting fixes
1 parent 508a1b9 commit cbdc2ba

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

dqe/src/main/java/org/opensearch/sql/dqe/planner/optimizer/PlanOptimizer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ private DqePlanNode pruneSubtree(DqePlanNode node, Set<String> requiredColumns)
243243
} else if (node instanceof AggregationNode aggNode) {
244244
DqePlanNode prunedChild = pruneSubtree(aggNode.getChild(), requiredColumns);
245245
return new AggregationNode(
246-
prunedChild, aggNode.getGroupByKeys(), aggNode.getAggregateFunctions(),
246+
prunedChild,
247+
aggNode.getGroupByKeys(),
248+
aggNode.getAggregateFunctions(),
247249
aggNode.getStep());
248250
}
249251
return node;
@@ -260,8 +262,7 @@ private void extractPredicateColumnRefs(String predicateString, Set<String> colu
260262
/** Extract column references from an aggregate function like "SUM(amount)". */
261263
private void extractAggregateColumnRefs(String funcStr, Set<String> columns) {
262264
Pattern aggPattern =
263-
Pattern.compile(
264-
"^\\s*(COUNT|SUM|MIN|MAX|AVG)\\((.+?)\\)\\s*$", Pattern.CASE_INSENSITIVE);
265+
Pattern.compile("^\\s*(COUNT|SUM|MIN|MAX|AVG)\\((.+?)\\)\\s*$", Pattern.CASE_INSENSITIVE);
265266
Matcher matcher = aggPattern.matcher(funcStr);
266267
if (matcher.matches()) {
267268
String arg = matcher.group(2).trim();

dqe/src/main/java/org/opensearch/sql/dqe/shard/executor/LocalExecutionPlanner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ private List<String> resolveInputColumns(DqePlanNode node) {
170170

171171
/**
172172
* Build a predicate function from a simple predicate string. Currently supports equality
173-
* predicates of the form "column = value" where the value is a long integer. Handles
174-
* surrounding parentheses that the Trino AST toString() may produce.
173+
* predicates of the form "column = value" where the value is a long integer. Handles surrounding
174+
* parentheses that the Trino AST toString() may produce.
175175
*/
176176
private BiFunction<Page, Integer, Boolean> buildPredicate(
177177
String predicateString, List<String> columns) {

dqe/src/main/java/org/opensearch/sql/dqe/shard/transport/TransportShardExecuteAction.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,7 @@ public ClearScrollResponse clearScroll(ClearScrollRequest request) {
225225
}
226226

227227
return new OpenSearchPageSource(
228-
searchClient,
229-
node.getIndexName(),
230-
req.getShardId(),
231-
dsl,
232-
columns,
233-
batchSize);
228+
searchClient, node.getIndexName(), req.getShardId(), dsl, columns, batchSize);
234229
};
235230
}
236231

dqe/src/test/java/org/opensearch/sql/dqe/planner/optimizer/PlanOptimizerTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ void fullChain() {
267267
// AggregationNode(FINAL, groupBy=category, aggs=COUNT(*)) -> TableScan(20 columns)
268268
// Note: This is an unusual plan shape, but tests that all rules fire.
269269
TableScanNode scan =
270-
new TableScanNode(
271-
"logs", List.of("category", "status", "message", "timestamp", "level"));
270+
new TableScanNode("logs", List.of("category", "status", "message", "timestamp", "level"));
272271
FilterNode filter = new FilterNode(scan, "status = 200");
273272
AggregationNode agg =
274273
new AggregationNode(
@@ -354,8 +353,7 @@ void negativeInteger() {
354353
@DisplayName("Converts string equality to term query")
355354
void stringEquality() {
356355
assertEquals(
357-
"{\"term\":{\"level\":\"error\"}}",
358-
PlanOptimizer.tryConvertToDsl("level = 'error'"));
356+
"{\"term\":{\"level\":\"error\"}}", PlanOptimizer.tryConvertToDsl("level = 'error'"));
359357
}
360358

361359
@Test
@@ -373,8 +371,7 @@ void complexPredicate() {
373371
@Test
374372
@DisplayName("Converts double equality to term query")
375373
void doubleEquality() {
376-
assertEquals(
377-
"{\"term\":{\"price\":19.99}}", PlanOptimizer.tryConvertToDsl("price = 19.99"));
374+
assertEquals("{\"term\":{\"price\":19.99}}", PlanOptimizer.tryConvertToDsl("price = 19.99"));
378375
}
379376
}
380377
}

0 commit comments

Comments
 (0)