alamb commented on code in PR #11920:
URL: https://github.com/apache/datafusion/pull/11920#discussion_r1713618503


##########
datafusion/functions/src/string/common.rs:
##########
@@ -68,6 +69,74 @@ pub(crate) fn general_trim<T: OffsetSizeTrait>(
         },
     };
 
+    if use_string_view {
+        string_view_trim::<T>(trim_type, func, args)
+    } else {
+        string_trim::<T>(trim_type, func, args)
+    }
+}
+
+// removing 'a will cause compiler complaining lifetime of `func`
+fn string_view_trim<'a, T: OffsetSizeTrait>(

Review Comment:
   This implementation is an improvement -- however, it will now copy the 
string values to a new `StringArray`
   
   I think if the function generated StringView output directly it would be 
possible to avoid all string copies (and only adjust the views).
   
   I can file this as a follow on optimization idea.
   
   However, we can 



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

Reply via email to