Skip to content

Commit 2e0c9d6

Browse files
committed
verifier test fixes
1 parent 2200e15 commit 2e0c9d6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ public void testWeightedAvg() {
12091209

12101210
public void testMatchInsideEval() throws Exception {
12111211
assertEquals(
1212-
"1:36: [:] operator is only supported in WHERE and STATS commands\n"
1212+
"1:36: [:] operator is only supported in WHERE and STATS commands, or in EVAL within score(.) function\n"
12131213
+ "line 1:36: [:] operator cannot operate on [title], which is not a field from an index mapping",
12141214
error("row title = \"brown fox\" | eval x = title:\"fox\" ")
12151215
);
@@ -1369,12 +1369,12 @@ public void testKqlFunctionsNotAllowedAfterCommands() throws Exception {
13691369
}
13701370

13711371
public void testQueryStringFunctionOnlyAllowedInWhere() throws Exception {
1372-
assertEquals("1:9: [QSTR] function is only supported in WHERE and STATS commands", error("row a = qstr(\"Anna\")"));
1372+
assertEquals("1:9: [QSTR] function is only supported in WHERE and STATS commands, or in EVAL within score(.) function", error("row a = qstr(\"Anna\")"));
13731373
checkFullTextFunctionsOnlyAllowedInWhere("QSTR", "qstr(\"Anna\")", "function");
13741374
}
13751375

13761376
public void testKqlFunctionOnlyAllowedInWhere() throws Exception {
1377-
assertEquals("1:9: [KQL] function is only supported in WHERE and STATS commands", error("row a = kql(\"Anna\")"));
1377+
assertEquals("1:9: [KQL] function is only supported in WHERE and STATS commands, or in EVAL within score(.) function", error("row a = kql(\"Anna\")"));
13781378
checkFullTextFunctionsOnlyAllowedInWhere("KQL", "kql(\"Anna\")", "function");
13791379
}
13801380

@@ -1394,11 +1394,11 @@ public void testMatchOperatornOnlyAllowedInWhere() throws Exception {
13941394
private void checkFullTextFunctionsOnlyAllowedInWhere(String functionName, String functionInvocation, String functionType)
13951395
throws Exception {
13961396
assertEquals(
1397-
"1:22: [" + functionName + "] " + functionType + " is only supported in WHERE and STATS commands",
1397+
"1:22: [" + functionName + "] " + functionType + " is only supported in WHERE and STATS commands, or in EVAL within score(.) function",
13981398
error("from test | eval y = " + functionInvocation)
13991399
);
14001400
assertEquals(
1401-
"1:18: [" + functionName + "] " + functionType + " is only supported in WHERE and STATS commands",
1401+
"1:18: [" + functionName + "] " + functionType + " is only supported in WHERE and STATS commands, or in EVAL within score(.) function",
14021402
error("from test | sort " + functionInvocation + " asc")
14031403
);
14041404
assertEquals(
@@ -2478,7 +2478,7 @@ public void testMultiMatchTargetsExistingField() throws Exception {
24782478
public void testMultiMatchInsideEval() throws Exception {
24792479
assumeTrue("MultiMatch operator is available just for snapshots", Build.current().isSnapshot());
24802480
assertEquals(
2481-
"1:36: [MultiMatch] function is only supported in WHERE and STATS commands\n"
2481+
"1:36: [MultiMatch] function is only supported in WHERE and STATS commands, or in EVAL within score(.) function\n"
24822482
+ "line 1:55: [MultiMatch] function cannot operate on [title], which is not a field from an index mapping",
24832483
error("row title = \"brown fox\" | eval x = multi_match(\"fox\", title)")
24842484
);

0 commit comments

Comments
 (0)