diff --git a/be/src/vec/functions/function_split_by_regexp.cpp b/be/src/vec/functions/function_split_by_regexp.cpp index e98278684df050..ea9bb6f05239bd 100644 --- a/be/src/vec/functions/function_split_by_regexp.cpp +++ b/be/src/vec/functions/function_split_by_regexp.cpp @@ -248,9 +248,6 @@ struct ExecuteImpl { if (pattern_ref.size) { re2_ptr = std::make_unique(pattern_ref.to_string_view(), *opts); } - if ((re2_ptr == nullptr) || (!re2_ptr->ok())) { - return Status::RuntimeError("Invalid pattern: {}", pattern_ref.debug_string()); - } RegexpSplit RegexpSplit; RegexpSplit.init(re2_ptr.get(), limit_value); for (int row = 0; row < input_rows_count; ++row) { diff --git a/regression-test/data/query_p0/sql_functions/string_functions/test_split_by_regexp.out b/regression-test/data/query_p0/sql_functions/string_functions/test_split_by_regexp.out index 1fb99f58ab1c7c..483d9d89f872e5 100644 --- a/regression-test/data/query_p0/sql_functions/string_functions/test_split_by_regexp.out +++ b/regression-test/data/query_p0/sql_functions/string_functions/test_split_by_regexp.out @@ -68,3 +68,29 @@ -- !select13 -- ["aa", "bbb", "cccc"] +-- !select14 -- +abcde ["a", "b", "c", "d", "e"] +12553 ["1", "2", "5", "5", "3"] + [] + [] + [] +a1b1c1d ["a", "1", "b", "1", "c", "1", "d"] +,,, [",", ",", ","] +a,b,c ["a", ",", "b", ",", "c"] +a,b,c, ["a", ",", "b", ",", "c", ","] +\N \N +a,b,c,12345, ["a", ",", "b", ",", "c", ",", "1", "2", "3", "4", "5", ","] + +-- !select15 -- + [] + [] + [] +, [","] +a ["a"] +1 ["1"] +, [","] +, [","] +, [","] +, [","] +, [","] + diff --git a/regression-test/suites/query_p0/sql_functions/string_functions/test_split_by_regexp.groovy b/regression-test/suites/query_p0/sql_functions/string_functions/test_split_by_regexp.groovy index 4b9719068e6606..394a8e721aafab 100644 --- a/regression-test/suites/query_p0/sql_functions/string_functions/test_split_by_regexp.groovy +++ b/regression-test/suites/query_p0/sql_functions/string_functions/test_split_by_regexp.groovy @@ -70,5 +70,7 @@ suite("test_split_by_regexp") { qt_select11 "select split_by_regexp('aa,bbb,cccc', ',', 4);" qt_select12 "select split_by_regexp('aa,bbb,cccc', ',', 100000000);" qt_select13 "select split_by_regexp('aa,bbb,cccc', ',', 10000000000000);" + qt_select14 "select v1,split_by_regexp(v1, '') from test_split_by_regexp order by k1;" + qt_select15 "select v2,split_by_regexp(v2, '') from test_split_by_regexp order by k1;" }