Skip to content

Commit 0742884

Browse files
committed
Spotless
1 parent 1774cb0 commit 0742884

File tree

1 file changed

+29
-17
lines changed

1 file changed

+29
-17
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,10 @@ public void testNonFieldBasedFullTextFunctionsNotAllowedAfterCommands(String fun
13401340
containsString("[" + functionName + "] function cannot be used after KEEP")
13411341
);
13421342
assertThat(
1343-
error("from test | STATS c = COUNT(id) BY category | rename c as total_categories | where " + functionInvocation, fullTextAnalyzer),
1343+
error(
1344+
"from test | STATS c = COUNT(id) BY category | rename c as total_categories | where " + functionInvocation,
1345+
fullTextAnalyzer
1346+
),
13441347
containsString("[" + functionName + "] function cannot be used after RENAME")
13451348
);
13461349
assertThat(
@@ -1403,36 +1406,45 @@ private void checkWithFullTextFunctionsDisjunctions(String functionInvocation) {
14031406
query("from test | where " + functionInvocation + " or length(title) > 10", fullTextAnalyzer);
14041407
query("from test | where match(title, \"Meditation\") or (" + functionInvocation + " and length(title) > 10)", fullTextAnalyzer);
14051408
query(
1406-
"from test | where ("
1407-
+ functionInvocation
1408-
+ " and length(title) > 0) or (match(title, \"Meditation\") and length(title) > 10)", fullTextAnalyzer
1409+
"from test | where (" + functionInvocation + " and length(title) > 0) or (match(title, \"Meditation\") and length(title) > 10)",
1410+
fullTextAnalyzer
14091411
);
14101412

14111413
// Disjunctions with non-pushable functions - no scoring
14121414
query("from test | where " + functionInvocation + " or length(title) > 10", fullTextAnalyzer);
14131415
query("from test | where match(title, \"Meditation\") or (" + functionInvocation + " and length(title) > 10)", fullTextAnalyzer);
14141416
query(
1415-
"from test | where ("
1416-
+ functionInvocation
1417-
+ " and length(title) > 0) or (match(title, \"Meditation\") and length(title) > 10)", fullTextAnalyzer
1417+
"from test | where (" + functionInvocation + " and length(title) > 0) or (match(title, \"Meditation\") and length(title) > 10)",
1418+
fullTextAnalyzer
14181419
);
14191420

14201421
// Disjunctions with full text functions - no scoring
14211422
query("from test | where " + functionInvocation + " or match(title, \"Meditation\")", fullTextAnalyzer);
14221423
query("from test | where " + functionInvocation + " or not match(title, \"Meditation\")", fullTextAnalyzer);
14231424
query("from test | where (" + functionInvocation + " or match(title, \"Meditation\")) and length(title) > 10", fullTextAnalyzer);
1424-
query("from test | where (" + functionInvocation + " or match(title, \"Meditation\")) and match(body, \"Smith\")", fullTextAnalyzer);
1425-
query("from test | where " + functionInvocation + " or (match(title, \"Meditation\") and match(body, \"Smith\"))", fullTextAnalyzer);
1425+
query(
1426+
"from test | where (" + functionInvocation + " or match(title, \"Meditation\")) and match(body, \"Smith\")",
1427+
fullTextAnalyzer
1428+
);
1429+
query(
1430+
"from test | where " + functionInvocation + " or (match(title, \"Meditation\") and match(body, \"Smith\"))",
1431+
fullTextAnalyzer
1432+
);
14261433

14271434
// Disjunctions with full text functions - scoring
14281435
query("from test metadata _score | where " + functionInvocation + " or match(title, \"Meditation\")", fullTextAnalyzer);
14291436
query("from test metadata _score | where " + functionInvocation + " or not match(title, \"Meditation\")", fullTextAnalyzer);
1430-
query("from test metadata _score | where (" + functionInvocation + " or match(title, \"Meditation\")) and length(title) > 10", fullTextAnalyzer);
14311437
query(
1432-
"from test metadata _score | where (" + functionInvocation + " or match(title, \"Meditation\")) and match(body, \"Smith\")", fullTextAnalyzer
1438+
"from test metadata _score | where (" + functionInvocation + " or match(title, \"Meditation\")) and length(title) > 10",
1439+
fullTextAnalyzer
14331440
);
14341441
query(
1435-
"from test metadata _score | where " + functionInvocation + " or (match(title, \"Meditation\") and match(body, \"Smith\"))", fullTextAnalyzer
1442+
"from test metadata _score | where (" + functionInvocation + " or match(title, \"Meditation\")) and match(body, \"Smith\")",
1443+
fullTextAnalyzer
1444+
);
1445+
query(
1446+
"from test metadata _score | where " + functionInvocation + " or (match(title, \"Meditation\") and match(body, \"Smith\"))",
1447+
fullTextAnalyzer
14361448
);
14371449
}
14381450

@@ -1517,10 +1529,7 @@ public void testFullTextFunctionsTargetsExistingField() throws Exception {
15171529
}
15181530

15191531
private void testFullTextFunctionTargetsExistingField(String functionInvocation) throws Exception {
1520-
assertThat(
1521-
error("from test | keep emp_no | where " + functionInvocation),
1522-
containsString("Unknown column")
1523-
);
1532+
assertThat(error("from test | keep emp_no | where " + functionInvocation), containsString("Unknown column"));
15241533
}
15251534

15261535
public void testConditionalFunctionsWithMixedNumericTypes() {
@@ -2175,7 +2184,10 @@ private void checkFullTextFunctionsInStats(String functionInvocation) {
21752184
query("from test | stats c = max(id) where " + functionInvocation, fullTextAnalyzer);
21762185
query("from test | stats c = max(id) where " + functionInvocation + " or length(title) > 10", fullTextAnalyzer);
21772186
query("from test metadata _score | where " + functionInvocation + " | stats c = max(_score)", fullTextAnalyzer);
2178-
query("from test metadata _score | where " + functionInvocation + " or length(title) > 10 | stats c = max(_score)", fullTextAnalyzer);
2187+
query(
2188+
"from test metadata _score | where " + functionInvocation + " or length(title) > 10 | stats c = max(_score)",
2189+
fullTextAnalyzer
2190+
);
21792191

21802192
assertThat(
21812193
error("from test metadata _score | stats c = max(_score) where " + functionInvocation, fullTextAnalyzer),

0 commit comments

Comments
 (0)