diff --git a/docs/changelog/131387.yaml b/docs/changelog/131387.yaml new file mode 100644 index 0000000000000..6f2bcaa19140e --- /dev/null +++ b/docs/changelog/131387.yaml @@ -0,0 +1,5 @@ +pr: 131387 +summary: Disable `ReplaceStringCasingWithInsensitiveRegexMatch` rule in 8.19 +area: ES|QL +type: bug +issues: [] diff --git a/muted-tests.yml b/muted-tests.yml index e65c3ae1326c7..d2ad9014dc13c 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -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 \ No newline at end of file + issue: https://github.com/elastic/elasticsearch/issues/131041 diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec index 0cc5cfe95db94..e44ceb1df4769 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec @@ -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 +Свердлов району +; + + diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizer.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizer.java index 6f89693d5c04c..26382ddd8ebde 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizer.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizer.java @@ -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; @@ -75,7 +74,8 @@ private static Batch 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)); } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizerTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizerTests.java index 8e76986c3c404..de12f62c07a4a 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizerTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizerTests.java @@ -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Ü*\""); @@ -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ü*\""); @@ -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Ü*\""); @@ -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Ü*\""); @@ -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ü*\""); @@ -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Ü*\""); diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/PhysicalPlanOptimizerTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/PhysicalPlanOptimizerTests.java index f734685cd36f9..0f69e964f3673 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/PhysicalPlanOptimizerTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/PhysicalPlanOptimizerTests.java @@ -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 @@ -2253,6 +2254,7 @@ public void testPushDownLowerCaseChangeRLike() { """); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041") public void testPushDownUpperCaseChangeRLike() { doTestPushDownCaseChangeRegexMatch(""" FROM test @@ -2278,6 +2280,7 @@ public void testPushDownUpperCaseChangeRLike() { """); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041") public void testPushDownLowerCaseChangeLike() { doTestPushDownCaseChangeRegexMatch(""" FROM test @@ -2301,6 +2304,7 @@ public void testPushDownLowerCaseChangeLike() { """); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/131041") public void testPushDownUpperCaseChangeLike() { doTestPushDownCaseChangeRegexMatch(""" FROM test @@ -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