Skip to content

Commit 18e18a2

Browse files
Fix UT fails
1 parent 029f96a commit 18e18a2

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ public void testUnsupportedAndMultiTypedFields() {
220220
// LOOKUP with unsupported type
221221
assertEquals(
222222
"1:43: column type mismatch, table column was [integer] and original column was [unsupported]",
223-
error("from test* | lookup_ int_number_names on int", analyzer)
223+
error("from test* | lookup_🐔 int_number_names on int", analyzer)
224224
);
225225
// LOOKUP with multi-typed field
226226
assertEquals(
227227
"1:46: column type mismatch, table column was [double] and original column was [unsupported]",
228-
error("from test* | lookup_ double_number_names on double", analyzer)
228+
error("from test* | lookup_🐔 double_number_names on double", analyzer)
229229
);
230230
}
231231

@@ -2187,7 +2187,7 @@ public void testInsistNotOnTopOfFrom() {
21872187
assumeTrue("requires snapshot builds", Build.current().isSnapshot());
21882188

21892189
assertThat(
2190-
error("FROM test | EVAL foo = 42 | INSIST_ bar"),
2190+
error("FROM test | EVAL foo = 42 | INSIST_🐔 bar"),
21912191
containsString("1:29: [insist] can only be used after [from] or [insist] commands, but was [EVAL foo = 42]")
21922192
);
21932193
}

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/230_folding.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ Foldable query using MATCH_PHRASE on name but with non-foldable expression:
262262
| KEEP hire_date, salary, salary_change, salary_change_long, name
263263
| LIMIT 5
264264
- match: { error.type: "verification_exception" }
265-
- contains: { error.reason: "Query must be a valid string in [MATCH_PHRASE(name, CONCAT(\"Bob \", name))], found [CONCAT(\"Bob \", name)]" }
265+
# We only check that the problematic string is there, because the error message is slightly different in old versions
266+
#second argument of [MATCH_PHRASE(name, CONCAT("Bob ", name))] must be a constant, received [CONCAT("Bob ", name)]"
267+
#Query must be a valid string in [MATCH_PHRASE(name, CONCAT(\"Bob \", name))], found [CONCAT(\"Bob \", name)]
268+
- contains: { error.reason: "[MATCH_PHRASE(name, CONCAT(\"Bob \", name))]" }
266269

267270
---
268271

@@ -285,7 +288,10 @@ Foldable query using MATCH_PHRASE on name but with non constant query:
285288
| KEEP hire_date, salary, salary_change, salary_change_long, name
286289
| LIMIT 5
287290
- match: { error.type: "verification_exception" }
288-
- contains: { error.reason: "Query must be a valid string in [MATCH_PHRASE(name, name)], found [name" }
291+
# We only check that the problematic string is there, because the error message is slightly different in old versions
292+
# second argument of [MATCH_PHRASE(name, name)] must be a constant, received [name]
293+
# Query must be a valid string in [MATCH_PHRASE(name, name)], found [name
294+
- contains: { error.reason: "[MATCH_PHRASE(name, name)]" }
289295

290296
---
291297

@@ -401,7 +407,10 @@ Foldable query using QSTR on name but with non-foldable expression:
401407
| KEEP hire_date, salary, salary_change, salary_change_long, name
402408
| LIMIT 5
403409
- match: { error.type: "verification_exception" }
404-
- contains: { error.reason: "Query must be a valid string in [QSTR(CONCAT(name, \"Bob\"))], found [CONCAT(name, \"Bob\")]" }
410+
# We only check that the problematic string is there, because the error message is slightly different in old versions
411+
#first argument of [QSTR(CONCAT(name, "Bob"))] must be a constant, received [CONCAT(name, "Bob")]"
412+
#Query must be a valid string in [QSTR(CONCAT(name, \"Bob\"))], found [CONCAT(name, \"Bob\")]
413+
- contains: { error.reason: "[QSTR(CONCAT(name, \"Bob\"))]" }
405414

406415
---
407416

0 commit comments

Comments
 (0)