pitrou commented on code in PR #45577:
URL: https://github.com/apache/arrow/pull/45577#discussion_r1969158638


##########
cpp/src/arrow/compute/kernels/scalar_string_test.cc:
##########
@@ -1958,6 +1960,29 @@ TYPED_TEST(TestBaseBinaryKernels, ExtractRegex) {
                    R"([{"letter": "a", "digit": "1"}, {"letter": "b", "digit": 
"3"}])",
                    &options);
 }
+TYPED_TEST(TestBaseBinaryKernels, ExtractRegexSapn) {
+  ExtractRegexSpanOptions options{"(?P<letter>[ab])(?P<digit>\\d)"};
+  auto type_fixe_size_list = is_binary_like(this->type()->id()) ? int32() : 
int64();
+  auto out_type = struct_({field("letter_span", 
fixed_size_list(type_fixe_size_list, 2)),
+                           field("digit_span", 
fixed_size_list(type_fixe_size_list, 2))});
+  this->CheckUnary("extract_regex_span", R"([])", out_type, R"([])", &options);
+  this->CheckUnary(
+      "extract_regex_span", R"(["a1", "b2", "c3", null])", out_type,
+      R"([{"letter_span":[0,1], "digit_span":[1,1]}, {"letter_span":[0,1], 
"digit_span":[1,1]}, null, null])",

Review Comment:
   I think the field names in the result should simply be "letter" and "digit" 
(i.e. don't append `_span`).



-- 
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]

Reply via email to