You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/08/12 11:58:03 UTC
Re: [PR] Implement native stringview support for BTRIM [datafusion]
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org