Skip to content

Commit 19548fa

Browse files
committed
Spotless
1 parent 3d70558 commit 19548fa

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
@@ -1344,7 +1344,10 @@ public void testNonFieldBasedFullTextFunctionsNotAllowedAfterCommands(String fun
13441344
containsString("[" + functionName + "] function cannot be used after KEEP")
13451345
);
13461346
assertThat(
1347-
error("from test | STATS c = COUNT(id) BY category | rename c as total_categories | where " + functionInvocation, fullTextAnalyzer),
1347+
error(
1348+
"from test | STATS c = COUNT(id) BY category | rename c as total_categories | where " + functionInvocation,
1349+
fullTextAnalyzer
1350+
),
13481351
containsString("[" + functionName + "] function cannot be used after RENAME")
13491352
);
13501353
assertThat(
@@ -1413,36 +1416,45 @@ private void checkWithFullTextFunctionsDisjunctions(String functionInvocation) {
14131416
query("from test | where " + functionInvocation + " or length(title) > 10", fullTextAnalyzer);
14141417
query("from test | where match(title, \"Meditation\") or (" + functionInvocation + " and length(title) > 10)", fullTextAnalyzer);
14151418
query(
1416-
"from test | where ("
1417-
+ functionInvocation
1418-
+ " and length(title) > 0) or (match(title, \"Meditation\") and length(title) > 10)", fullTextAnalyzer
1419+
"from test | where (" + functionInvocation + " and length(title) > 0) or (match(title, \"Meditation\") and length(title) > 10)",
1420+
fullTextAnalyzer
14191421
);
14201422

14211423
// Disjunctions with non-pushable functions - no scoring
14221424
query("from test | where " + functionInvocation + " or length(title) > 10", fullTextAnalyzer);
14231425
query("from test | where match(title, \"Meditation\") or (" + functionInvocation + " and length(title) > 10)", fullTextAnalyzer);
14241426
query(
1425-
"from test | where ("
1426-
+ functionInvocation
1427-
+ " and length(title) > 0) or (match(title, \"Meditation\") and length(title) > 10)", fullTextAnalyzer
1427+
"from test | where (" + functionInvocation + " and length(title) > 0) or (match(title, \"Meditation\") and length(title) > 10)",
1428+
fullTextAnalyzer
14281429
);
14291430

14301431
// Disjunctions with full text functions - no scoring
14311432
query("from test | where " + functionInvocation + " or match(title, \"Meditation\")", fullTextAnalyzer);
14321433
query("from test | where " + functionInvocation + " or not match(title, \"Meditation\")", fullTextAnalyzer);
14331434
query("from test | where (" + functionInvocation + " or match(title, \"Meditation\")) and length(title) > 10", fullTextAnalyzer);
1434-
query("from test | where (" + functionInvocation + " or match(title, \"Meditation\")) and match(body, \"Smith\")", fullTextAnalyzer);
1435-
query("from test | where " + functionInvocation + " or (match(title, \"Meditation\") and match(body, \"Smith\"))", fullTextAnalyzer);
1435+
query(
1436+
"from test | where (" + functionInvocation + " or match(title, \"Meditation\")) and match(body, \"Smith\")",
1437+
fullTextAnalyzer
1438+
);
1439+
query(
1440+
"from test | where " + functionInvocation + " or (match(title, \"Meditation\") and match(body, \"Smith\"))",
1441+
fullTextAnalyzer
1442+
);
14361443

14371444
// Disjunctions with full text functions - scoring
14381445
query("from test metadata _score | where " + functionInvocation + " or match(title, \"Meditation\")", fullTextAnalyzer);
14391446
query("from test metadata _score | where " + functionInvocation + " or not match(title, \"Meditation\")", fullTextAnalyzer);
1440-
query("from test metadata _score | where (" + functionInvocation + " or match(title, \"Meditation\")) and length(title) > 10", fullTextAnalyzer);
14411447
query(
1442-
"from test metadata _score | where (" + functionInvocation + " or match(title, \"Meditation\")) and match(body, \"Smith\")", fullTextAnalyzer
1448+
"from test metadata _score | where (" + functionInvocation + " or match(title, \"Meditation\")) and length(title) > 10",
1449+
fullTextAnalyzer
14431450
);
14441451
query(
1445-
"from test metadata _score | where " + functionInvocation + " or (match(title, \"Meditation\") and match(body, \"Smith\"))", fullTextAnalyzer
1452+
"from test metadata _score | where (" + functionInvocation + " or match(title, \"Meditation\")) and match(body, \"Smith\")",
1453+
fullTextAnalyzer
1454+
);
1455+
query(
1456+
"from test metadata _score | where " + functionInvocation + " or (match(title, \"Meditation\") and match(body, \"Smith\"))",
1457+
fullTextAnalyzer
14461458
);
14471459
}
14481460

@@ -1533,10 +1545,7 @@ public void testFullTextFunctionsTargetsExistingField() throws Exception {
15331545
}
15341546

15351547
private void testFullTextFunctionTargetsExistingField(String functionInvocation) throws Exception {
1536-
assertThat(
1537-
error("from test | keep emp_no | where " + functionInvocation),
1538-
containsString("Unknown column")
1539-
);
1548+
assertThat(error("from test | keep emp_no | where " + functionInvocation), containsString("Unknown column"));
15401549
}
15411550

15421551
public void testConditionalFunctionsWithMixedNumericTypes() {
@@ -2207,7 +2216,10 @@ private void checkFullTextFunctionsInStats(String functionInvocation) {
22072216
query("from test | stats c = max(id) where " + functionInvocation, fullTextAnalyzer);
22082217
query("from test | stats c = max(id) where " + functionInvocation + " or length(title) > 10", fullTextAnalyzer);
22092218
query("from test metadata _score | where " + functionInvocation + " | stats c = max(_score)", fullTextAnalyzer);
2210-
query("from test metadata _score | where " + functionInvocation + " or length(title) > 10 | stats c = max(_score)", fullTextAnalyzer);
2219+
query(
2220+
"from test metadata _score | where " + functionInvocation + " or length(title) > 10 | stats c = max(_score)",
2221+
fullTextAnalyzer
2222+
);
22112223

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

0 commit comments

Comments
 (0)