Skip to content

Commit 4fa47a7

Browse files
committed
fix it for rex
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
1 parent 185c569 commit 4fa47a7

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteRexCommandIT.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void testRexWithFiltering() throws IOException {
5656
executeQuery(
5757
String.format(
5858
"source=%s | rex field=address"
59-
+ " \\\"(?<streetnum>\\\\\\\\d+)\\\\\\\\s+(?<streetname>.+)\\\" | fields"
59+
+ " \\\"(?<streetnum>\\\\d+)\\\\s+(?<streetname>.+)\\\" | fields"
6060
+ " address, streetnum, streetname",
6161
TEST_INDEX_ACCOUNT));
6262

@@ -104,7 +104,7 @@ public void testRexComplexPattern() throws IOException {
104104
executeQuery(
105105
String.format(
106106
"source=%s | rex field=email"
107-
+ " \\\"(?<user>[a-zA-Z0-9._%%+-]+)@(?<domain>[a-zA-Z0-9.-]+)\\\\\\\\.(?<tld>[a-zA-Z]{2,})\\\""
107+
+ " \\\"(?<user>[a-zA-Z0-9._%%+-]+)@(?<domain>[a-zA-Z0-9.-]+)\\\\.(?<tld>[a-zA-Z]{2,})\\\""
108108
+ " | fields email, user, domain, tld",
109109
TEST_INDEX_ACCOUNT));
110110

@@ -154,7 +154,7 @@ public void testRexMaxMatchZeroLimitedToDefaultTen() throws IOException {
154154
JSONObject result =
155155
executeQuery(
156156
String.format(
157-
"source=%s | rex field=address \\\"(?<digit>\\\\\\\\d*)\\\" max_match=0 | eval"
157+
"source=%s | rex field=address \\\"(?<digit>\\\\d*)\\\" max_match=0 | eval"
158158
+ " digit_count=array_length(digit) | fields address, digit_count | head 1",
159159
TEST_INDEX_ACCOUNT));
160160

@@ -168,7 +168,7 @@ public void testRexMaxMatchExceedsDefaultLimit() throws IOException {
168168
try {
169169
executeQuery(
170170
String.format(
171-
"source=%s | rex field=address \\\"(?<digit>\\\\\\\\d+)\\\" max_match=100 | fields"
171+
"source=%s | rex field=address \\\"(?<digit>\\\\d+)\\\" max_match=100 | fields"
172172
+ " address, digit",
173173
TEST_INDEX_ACCOUNT));
174174
fail("Should have thrown an exception for max_match exceeding default limit");
@@ -183,7 +183,7 @@ public void testRexMaxMatchWithinDefaultLimit() throws IOException {
183183
JSONObject result =
184184
executeQuery(
185185
String.format(
186-
"source=%s | rex field=address \\\"(?<digit>\\\\\\\\d*)\\\" max_match=5 | eval"
186+
"source=%s | rex field=address \\\"(?<digit>\\\\d*)\\\" max_match=5 | eval"
187187
+ " digit_count=array_length(digit) | fields address, digit_count | head 1",
188188
TEST_INDEX_ACCOUNT));
189189

@@ -197,7 +197,7 @@ public void testRexMaxMatchAtDefaultLimit() throws IOException {
197197
JSONObject result =
198198
executeQuery(
199199
String.format(
200-
"source=%s | rex field=address \\\"(?<digit>\\\\\\\\d*)\\\" max_match=10 | eval"
200+
"source=%s | rex field=address \\\"(?<digit>\\\\d*)\\\" max_match=10 | eval"
201201
+ " digit_count=array_length(digit) | fields address, digit_count | head 1",
202202
TEST_INDEX_ACCOUNT));
203203

@@ -217,7 +217,7 @@ public void testRexMaxMatchConfigurableLimit() throws IOException {
217217
JSONObject result =
218218
executeQuery(
219219
String.format(
220-
"source=%s | rex field=address \\\"(?<digit>\\\\\\\\d*)\\\" max_match=0 | eval"
220+
"source=%s | rex field=address \\\"(?<digit>\\\\d*)\\\" max_match=0 | eval"
221221
+ " digit_count=array_length(digit) | fields address, digit_count | head 1",
222222
TEST_INDEX_ACCOUNT));
223223

@@ -229,7 +229,7 @@ public void testRexMaxMatchConfigurableLimit() throws IOException {
229229
try {
230230
executeQuery(
231231
String.format(
232-
"source=%s | rex field=address \\\"(?<digit>\\\\\\\\d+)\\\" max_match=10 | fields"
232+
"source=%s | rex field=address \\\"(?<digit>\\\\d+)\\\" max_match=10 | fields"
233233
+ " address, digit",
234234
TEST_INDEX_ACCOUNT));
235235
fail("Should have thrown an exception for max_match exceeding custom limit");

0 commit comments

Comments
 (0)