linrrzqqq commented on code in PR #66050:
URL: https://github.com/apache/doris/pull/66050#discussion_r3680041273
##########
regression-test/suites/query_p0/sql_functions/string_functions/test_string_function_regexp.groovy:
##########
@@ -255,4 +255,11 @@ suite("test_string_function_regexp") {
qt_sql_field4 "SELECT FIELD('21','2130', '2131', '21');"
qt_sql_field5 "SELECT FIELD(21, 2130, 21, 2131);"
+
+ qt_sql_regexp_extract_all_group0 "select
regexp_extract_all('x=a3&x=18abc&x=2&y=3&x=4&x=17bcd', 'x=([0-9]+)([a-z]+)',
0);"
+ qt_sql_regexp_extract_all_group2 "select
regexp_extract_all('x=a3&x=18abc&x=2&y=3&x=4&x=17bcd', 'x=([0-9]+)([a-z]+)',
2);"
+ qt_sql_regexp_extract_all_group_negative "select regexp_extract_all('abc',
'(b)', -1);"
+ qt_sql_regexp_extract_all_array_group0 "select
regexp_extract_all_array('x=a3&x=18abc&x=2&y=3&x=4&x=17bcd',
'x=([0-9]+)([a-z]+)', 0);"
+ qt_sql_regexp_extract_all_array_group2 "select
regexp_extract_all_array('x=a3&x=18abc&x=2&y=3&x=4&x=17bcd',
'x=([0-9]+)([a-z]+)', 2);"
+ qt_sql_regexp_extract_all_array_group_out_of_range "select
regexp_extract_all_array('hitdecisiondlist', '(i)(.*?)(e)', 3);"
Review Comment:
btw, why this case named after `_out_of_range`?
I think `(i)(.*?)(e)` has three capturing groups, so index 3 is valid and
should extract "e". The first out-of-range index is 4.
seems to be some issue in ur impl:
```sql
spark-sql (default)> select regexp_extract_all('hitdecisiondlist',
'(i)(.*?)(e)', 3);
["e"]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]