Skip to content

Commit baa5252

Browse files
Add more UTs, including Unicode and ToUpper
1 parent ebf9050 commit baa5252

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,60 @@ FROM employees
588588
emp_no:integer | first_name:keyword
589589
;
590590

591+
rlikeListWithUpperAllLower
592+
required_capability: rlike_with_list_of_patterns
593+
FROM employees
594+
| WHERE TO_UPPER(first_name) RLIKE ("geor.*", "wei.*")
595+
| KEEP emp_no, first_name
596+
| SORT emp_no;
597+
598+
emp_no:integer | first_name:keyword
599+
;
600+
601+
rlikeListWithUpperAllUpper
602+
required_capability: rlike_with_list_of_patterns
603+
FROM employees
604+
| WHERE TO_UPPER(first_name) RLIKE ("GEOR.*", "WEI.*")
605+
| KEEP emp_no, first_name
606+
| SORT emp_no;
607+
608+
emp_no:integer | first_name:keyword
609+
10001 | Georgi
610+
10040 | Weiyi
611+
10055 | Georgy
612+
;
613+
614+
rlikeListWithUpperMixedCase
615+
required_capability: rlike_with_list_of_patterns
616+
FROM employees
617+
| WHERE TO_UPPER(first_name) RLIKE ("GeOr.*", "wEiY.*", "bErNi")
618+
| KEEP emp_no, first_name
619+
| SORT emp_no;
620+
621+
emp_no:integer | first_name:keyword
622+
;
623+
624+
rlikeListWithUpperMultiplePatternsMixedCase
625+
required_capability: rlike_with_list_of_patterns
626+
FROM employees
627+
| WHERE TO_UPPER(first_name) RLIKE ("geor*", "WEIYI.*", "bErnI.*")
628+
| KEEP emp_no, first_name
629+
| SORT emp_no;
630+
631+
emp_no:integer | first_name:keyword
632+
10040 | Weiyi
633+
;
634+
635+
rlikeListWithUpperNoMatch
636+
required_capability: rlike_with_list_of_patterns
637+
FROM employees
638+
| WHERE TO_UPPER(first_name) RLIKE ("notaname.*")
639+
| KEEP emp_no, first_name
640+
| SORT emp_no;
641+
642+
emp_no:integer | first_name:keyword
643+
;
644+
591645
rlikeListEmptyArgWildcard
592646
required_capability: rlike_with_list_of_patterns
593647
FROM employees
@@ -1390,3 +1444,26 @@ ROW x = "abc" | EVAL bool = x RLIKE "#"
13901444
x:keyword | bool:boolean
13911445
abc | false
13921446
;
1447+
1448+
rlikeWithLowerTurnedInsensitiveUnicode#[skip:-8.12.99]
1449+
FROM airport_city_boundaries
1450+
| WHERE TO_UPPER(region) RLIKE ".*Л.*" and abbrev == "FRU"
1451+
| KEEP region
1452+
| LIMIT 1
1453+
;
1454+
1455+
region:text
1456+
Свердлов району
1457+
;
1458+
1459+
rlikeListWithLowerTurnedInsensitiveUnicode
1460+
required_capability: rlike_with_list_of_patterns
1461+
FROM airport_city_boundaries
1462+
| WHERE TO_UPPER(region) RLIKE (".*Л.*", ".*NOT EXISTS.*") and abbrev == "FRU"
1463+
| KEEP region
1464+
| LIMIT 1
1465+
;
1466+
1467+
region:text
1468+
Свердлов району
1469+
;

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ public void testReplaceUpperStringCasinqgWithInsensitiveRLike() {
677677

678678
/*
679679
*Limit[1000[INTEGER],false]
680-
* \_Filter[RLikeList(first_name{f}#4, "("VALÜ*", "VALÜAA*")", true)]
680+
* \_Filter[RLikeList(first_name{f}#4, "("VALÜ*", "TEST*")", true)]
681681
* \_EsRelation[test][_meta_field{f}#9, emp_no{f}#3, first_name{f}#4, gen..]
682682
*/
683683
public void testReplaceUpperStringCasinqWithInsensitiveRLikeList() {

0 commit comments

Comments
 (0)