Skip to content

Commit a7a71c1

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent bd913b5 commit a7a71c1

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private <T> T invokeParser(
112112
return result.apply(new AstBuilder(new ExpressionBuilder.ParsingContext(params, metrics)), tree);
113113
} catch (StackOverflowError e) {
114114
throw new ParsingException("ESQL statement is too large, causing stack overflow when generating the parsing tree: [{}]", query);
115-
// likely thrown by an invalid popMode (such as extra closing parenthesis)
115+
// likely thrown by an invalid popMode (such as extra closing parenthesis)
116116
} catch (EmptyStackException ese) {
117117
throw new ParsingException("Invalid query [{}]", query);
118118
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public void testStatsWithoutAggsOrGroup() {
324324
}
325325

326326
public void testAggsWithGroupKeyAsAgg() {
327-
var queries = new String[]{"""
327+
var queries = new String[] { """
328328
row a = 1, b = 2
329329
| stats a by a
330330
""", """
@@ -337,7 +337,7 @@ public void testAggsWithGroupKeyAsAgg() {
337337
""", """
338338
row a = 1, b = 2
339339
| stats x = a by a
340-
"""};
340+
""" };
341341

342342
for (String query : queries) {
343343
expectVerificationError(query, "grouping key [a] already specified in the STATS BY clause");
@@ -683,16 +683,16 @@ public void testInvalidQuotingAsLookupIndexPattern() {
683683
}
684684

685685
public void testIdentifierAsFieldName() {
686-
String[] operators = new String[]{"==", "!=", ">", "<", ">=", "<="};
687-
Class<?>[] expectedOperators = new Class<?>[]{
686+
String[] operators = new String[] { "==", "!=", ">", "<", ">=", "<=" };
687+
Class<?>[] expectedOperators = new Class<?>[] {
688688
Equals.class,
689689
Not.class,
690690
GreaterThan.class,
691691
LessThan.class,
692692
GreaterThanOrEqual.class,
693-
LessThanOrEqual.class};
694-
String[] identifiers = new String[]{"abc", "`abc`", "ab_c", "a.b.c", "@a", "a.@b", "`a@b.c`"};
695-
String[] expectedIdentifiers = new String[]{"abc", "abc", "ab_c", "a.b.c", "@a", "a.@b", "a@b.c"};
693+
LessThanOrEqual.class };
694+
String[] identifiers = new String[] { "abc", "`abc`", "ab_c", "a.b.c", "@a", "a.@b", "`a@b.c`" };
695+
String[] expectedIdentifiers = new String[] { "abc", "abc", "ab_c", "a.b.c", "@a", "a.@b", "a@b.c" };
696696
LogicalPlan where;
697697
for (int i = 0; i < operators.length; i++) {
698698
for (int j = 0; j < identifiers.length; j++) {
@@ -848,7 +848,7 @@ public void testSingleLineComments() {
848848
}
849849

850850
public void testNewLines() {
851-
String[] delims = new String[]{"", "\r", "\n", "\r\n"};
851+
String[] delims = new String[] { "", "\r", "\n", "\r\n" };
852852
Function<String, String> queryFun = d -> d + "from " + d + " foo " + d + "| eval " + d + " x = concat(bar, \"baz\")" + d;
853853
LogicalPlan reference = statement(queryFun.apply(delims[0]));
854854
for (int i = 1; i < delims.length; i++) {
@@ -2722,13 +2722,13 @@ public void testNamedFunctionArgumentNotInMap() {
27222722

27232723
public void testNamedFunctionArgumentNotConstant() {
27242724
Map<String, String[]> commands = Map.ofEntries(
2725-
Map.entry("eval x = {}", new String[]{"31", "35"}),
2726-
Map.entry("where {}", new String[]{"28", "32"}),
2727-
Map.entry("stats {}", new String[]{"28", "32"}),
2728-
Map.entry("stats agg() by {}", new String[]{"37", "41"}),
2729-
Map.entry("sort {}", new String[]{"27", "31"}),
2730-
Map.entry("dissect {} \"%{bar}\"", new String[]{"30", "34"}),
2731-
Map.entry("grok {} \"%{WORD:foo}\"", new String[]{"27", "31"})
2725+
Map.entry("eval x = {}", new String[] { "31", "35" }),
2726+
Map.entry("where {}", new String[] { "28", "32" }),
2727+
Map.entry("stats {}", new String[] { "28", "32" }),
2728+
Map.entry("stats agg() by {}", new String[] { "37", "41" }),
2729+
Map.entry("sort {}", new String[] { "27", "31" }),
2730+
Map.entry("dissect {} \"%{bar}\"", new String[] { "30", "34" }),
2731+
Map.entry("grok {} \"%{WORD:foo}\"", new String[] { "27", "31" })
27322732
);
27332733

27342734
for (Map.Entry<String, String[]> command : commands.entrySet()) {
@@ -3091,7 +3091,7 @@ public void testInvalidFork() {
30913091
}
30923092

30933093
public void testFieldNamesAsCommands() throws Exception {
3094-
String[] keywords = new String[]{
3094+
String[] keywords = new String[] {
30953095
"dissect",
30963096
"drop",
30973097
"enrich",
@@ -3104,7 +3104,7 @@ public void testFieldNamesAsCommands() throws Exception {
31043104
"mv_expand",
31053105
"rename",
31063106
"sort",
3107-
"stats"};
3107+
"stats" };
31083108
for (String keyword : keywords) {
31093109
var plan = statement("FROM test | STATS avg(" + keyword + ")");
31103110
var aggregate = as(plan, Aggregate.class);
@@ -3154,7 +3154,7 @@ public void testValidRrf() {
31543154
}
31553155

31563156
public void testUnclosedParenthesis() {
3157-
String [] queries = { "row a = )" , "row ]", "from source | eval x = [1,2,3]]"};
3157+
String[] queries = { "row a = )", "row ]", "from source | eval x = [1,2,3]]" };
31583158
for (String q : queries) {
31593159
expectError(q, "Invalid query");
31603160
}

0 commit comments

Comments
 (0)