houqp commented on a change in pull request #1065:
URL: https://github.com/apache/arrow-datafusion/pull/1065#discussion_r719935814



##########
File path: datafusion/src/physical_plan/regex_expressions.rs
##########
@@ -47,10 +47,17 @@ macro_rules! downcast_string_arg {
 /// extract a specific group from a string column, using a regular expression
 pub fn regexp_match<T: StringOffsetSizeTrait>(args: &[ArrayRef]) -> 
Result<ArrayRef> {
     match args.len() {
-        2 => compute::regexp_match(downcast_string_arg!(args[0], "string", T), 
downcast_string_arg!(args[1], "pattern", T), None)
-        .map_err(DataFusionError::ArrowError),
-        3 => compute::regexp_match(downcast_string_arg!(args[0], "string", T), 
downcast_string_arg!(args[1], "pattern", T),  
Some(downcast_string_arg!(args[1], "flags", T)))
-        .map_err(DataFusionError::ArrowError),
+        2 => {
+            let values = downcast_string_arg!(args[0], "string", T);
+            let regex = downcast_string_arg!(args[1], "pattern", T);
+            compute::regexp_match(values, regex, 
None).map_err(DataFusionError::ArrowError)
+        }
+        3 => {
+            let values = downcast_string_arg!(args[0], "string", T);
+            let regex = downcast_string_arg!(args[1], "pattern", T);
+            let flags = Some(downcast_string_arg!(args[2], "flags", T));

Review comment:
       this line is the fix, index was 1 before the fix.




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