You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "martin-g (via GitHub)" <gi...@apache.org> on 2026/02/18 07:57:53 UTC

Re: [PR] perf: Optimize concat()/concat_ws() UDFs [datafusion]

martin-g commented on code in PR #20317:
URL: https://github.com/apache/datafusion/pull/20317#discussion_r2820855205


##########
datafusion/functions/src/string/concat.rs:
##########
@@ -207,7 +207,7 @@ impl ScalarUDFImpl for ConcatFunc {
                         DataType::Utf8View => {
                             let string_array = as_string_view_array(array)?;
 
-                            data_size += string_array.len();
+                            data_size += string_array.total_buffer_bytes_used();

Review Comment:
   This does not include the inlined strings (shorter than 12 bytes). An array of only short strings will report `0`.
   Is this a problem ?!
   
   If YES then let's use something like:
   ```rust
   self.views().iter().sum().min(usize::MAX) as usize
   ```



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