Skip to content

Commit d9dd180

Browse files
committed
Add IT test
Needed to trigger filter pushdown.
1 parent 6b56524 commit d9dd180

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,36 @@ public void testAsyncGetWithoutContentType() throws IOException {
14081408
.item(matchesMap().entry("name", "integer").entry("type", "integer")),
14091409
values
14101410
);
1411+
}
14111412

1413+
public void testReplaceStringCasingWithInsensitiveWildcardMatch() throws IOException {
1414+
createIndex(testIndexName(), Settings.EMPTY, """
1415+
{
1416+
"properties": {
1417+
"reserved": {
1418+
"type": "keyword"
1419+
},
1420+
"optional": {
1421+
"type": "keyword"
1422+
}
1423+
}
1424+
}
1425+
""");
1426+
Request doc = new Request("POST", testIndexName() + "/_doc?refresh=true");
1427+
doc.setJsonEntity("""
1428+
{
1429+
"reserved": "_\\"_$_(_)_+_._[_]_^_{_|_}___",
1430+
"optional": "_#_&_<_>___"
1431+
}
1432+
""");
1433+
client().performRequest(doc);
1434+
var query = "FROM " + testIndexName() + """
1435+
| WHERE TO_LOWER(reserved) LIKE "_\\"_$_(_)_+_._[_]_^_{_|_}*"
1436+
| WHERE TO_LOWER(optional) LIKE "_#_&_<_>*"
1437+
| KEEP reserved, optional
1438+
""";
1439+
var answer = runEsql(requestObjectBuilder().query(query));
1440+
assertThat(answer.get("values"), equalTo(List.of(List.of("_\"_$_(_)_+_._[_]_^_{_|_}___", "_#_&_<_>___"))));
14121441
}
14131442

14141443
protected static Request prepareRequestWithOptions(RequestObjectBuilder requestObject, Mode mode) throws IOException {

0 commit comments

Comments
 (0)