Skip to content

disable ReplaceStringCasingWithInsensitiveRegexMatch rule in 8.19 #131387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/131387.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 131387
summary: Disable `ReplaceStringCasingWithInsensitiveRegexMatch` rule in 8.19
area: ES|QL
type: bug
issues: []
2 changes: 1 addition & 1 deletion muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,4 +411,4 @@ tests:
issue: https://github.com/elastic/elasticsearch/issues/126085
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
method: test {yaml=reference/search/retriever/line_906}
issue: https://github.com/elastic/elasticsearch/issues/131041
issue: https://github.com/elastic/elasticsearch/issues/131041
Original file line number Diff line number Diff line change
Expand Up @@ -874,3 +874,16 @@ emp_no:integer |first_name:keyword
10001 |Georgi
10055 |Georgy
;

rlikeWithLowerTurnedInsensitiveUnicode#[skip:-8.12.99]
FROM airport_city_boundaries
| WHERE TO_UPPER(region) RLIKE ".*Л.*" and abbrev == "FRU"
| KEEP region
| LIMIT 1
;

region:text
Свердлов району
;


Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import org.elasticsearch.xpack.esql.optimizer.rules.logical.PropagateEmptyRelation;
import org.elasticsearch.xpack.esql.optimizer.rules.logical.ReplaceStatsFilteredAggWithEval;
import org.elasticsearch.xpack.esql.optimizer.rules.logical.ReplaceStringCasingWithInsensitiveRegexMatch;
import org.elasticsearch.xpack.esql.optimizer.rules.logical.local.InferIsNotNull;
import org.elasticsearch.xpack.esql.optimizer.rules.logical.local.InferNonNullAggConstraint;
import org.elasticsearch.xpack.esql.optimizer.rules.logical.local.LocalPropagateEmptyRelation;
Expand Down Expand Up @@ -75,7 +74,8 @@ private static Batch<LogicalPlan> localOperators() {
}

// add rule that should only apply locally
newRules.add(new ReplaceStringCasingWithInsensitiveRegexMatch());
// Waiting on https://github.com/elastic/elasticsearch/issues/131386
// newRules.add(new ReplaceStringCasingWithInsensitiveRegexMatch());

return operators.with(newRules.toArray(Rule[]::new));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ public void testIsNotNullOnCase_With_IS_NULL() {
* \_Filter[RLIKE(first_name{f}#4, "VALÜ*", true)]
* \_EsRelation[test][_meta_field{f}#9, emp_no{f}#3, first_name{f}#4, gen..]
*/
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testReplaceUpperStringCasinqgWithInsensitiveRLike() {
var plan = localPlan("FROM test | WHERE TO_UPPER(TO_LOWER(TO_UPPER(first_name))) RLIKE \"VALÜ*\"");

Expand All @@ -660,6 +661,7 @@ public void testReplaceUpperStringCasinqgWithInsensitiveRLike() {
}

// same plan as above, but lower case pattern
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testReplaceLowerStringCasingWithInsensitiveRLike() {
var plan = localPlan("FROM test | WHERE TO_LOWER(TO_UPPER(first_name)) RLIKE \"valü*\"");

Expand All @@ -677,6 +679,7 @@ public void testReplaceLowerStringCasingWithInsensitiveRLike() {
* LocalRelation[[_meta_field{f}#9, emp_no{f}#3, first_name{f}#4, gender{f}#5, hire_date{f}#10, job{f}#11, job.raw{f}#12, langu
* ages{f}#6, last_name{f}#7, long_noidx{f}#13, salary{f}#8],EMPTY]
*/
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testReplaceStringCasingAndRLikeWithLocalRelation() {
var plan = localPlan("FROM test | WHERE TO_LOWER(TO_UPPER(first_name)) RLIKE \"VALÜ*\"");

Expand All @@ -685,6 +688,7 @@ public void testReplaceStringCasingAndRLikeWithLocalRelation() {
}

// same plan as in testReplaceUpperStringCasingWithInsensitiveRLike, but with LIKE instead of RLIKE
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testReplaceUpperStringCasingWithInsensitiveLike() {
var plan = localPlan("FROM test | WHERE TO_UPPER(TO_LOWER(TO_UPPER(first_name))) LIKE \"VALÜ*\"");

Expand All @@ -699,6 +703,7 @@ public void testReplaceUpperStringCasingWithInsensitiveLike() {
}

// same plan as above, but lower case pattern
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testReplaceLowerStringCasingWithInsensitiveLike() {
var plan = localPlan("FROM test | WHERE TO_LOWER(TO_UPPER(first_name)) LIKE \"valü*\"");

Expand All @@ -716,6 +721,7 @@ public void testReplaceLowerStringCasingWithInsensitiveLike() {
* LocalRelation[[_meta_field{f}#9, emp_no{f}#3, first_name{f}#4, gender{f}#5, hire_date{f}#10, job{f}#11, job.raw{f}#12, langu
* ages{f}#6, last_name{f}#7, long_noidx{f}#13, salary{f}#8],EMPTY]
*/
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testReplaceStringCasingAndLikeWithLocalRelation() {
var plan = localPlan("FROM test | WHERE TO_LOWER(TO_UPPER(first_name)) LIKE \"VALÜ*\"");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,7 @@ private void doTestPushDownCaseChangeRegexMatch(String query, String expected) {
assertThat(stripThrough(singleValue.toString()), is(stripThrough(expected)));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testPushDownLowerCaseChangeRLike() {
doTestPushDownCaseChangeRegexMatch("""
FROM test
Expand All @@ -2253,6 +2254,7 @@ public void testPushDownLowerCaseChangeRLike() {
""");
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testPushDownUpperCaseChangeRLike() {
doTestPushDownCaseChangeRegexMatch("""
FROM test
Expand All @@ -2278,6 +2280,7 @@ public void testPushDownUpperCaseChangeRLike() {
""");
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testPushDownLowerCaseChangeLike() {
doTestPushDownCaseChangeRegexMatch("""
FROM test
Expand All @@ -2301,6 +2304,7 @@ public void testPushDownLowerCaseChangeLike() {
""");
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testPushDownUpperCaseChangeLike() {
doTestPushDownCaseChangeRegexMatch("""
FROM test
Expand Down Expand Up @@ -2336,6 +2340,7 @@ public void testPushDownUpperCaseChangeLike() {
* \_FieldExtractExec[first_name{f}#5, emp_no{f}#4]<[],[]>
* \_EsQueryExec[test], indexMode[standard], query[][_doc{f}#26], limit[], sort[] estimatedRowSize[332]
*/
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041")
public void testChangeCaseAsInsensitiveWildcardLikeNotPushedDown() {
var esql = """
FROM test
Expand Down