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


##########
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:
   My suggestion is similar to the impl at 
https://github.com/apache/arrow-rs/blob/2f40f78e4feae3aee261d9608cede9535e1429e0/arrow-array/src/array/byte_view_array.rs#L685.
 It just does not filter out the small strings and uses u128 for the sum before 
the final cast.



##########
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:
   My suggestion is similar to the impl at 
https://github.com/apache/arrow-rs/blob/2f40f78e4feae3aee261d9608cede9535e1429e0/arrow-array/src/array/byte_view_array.rs#L685.
 It just does not filter out the small strings and uses u128 for the sum before 
the final cast to 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: [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