neilconway commented on code in PR #21754:
URL: https://github.com/apache/datafusion/pull/21754#discussion_r3118375117


##########
datafusion/functions/src/unicode/substrindex.rs:
##########
@@ -130,126 +146,469 @@ fn substr_index(args: &[ArrayRef]) -> Result<ArrayRef> {
             let string_array = str.as_string::<i32>();
             let delimiter_array = delim.as_string::<i32>();
             let count_array: &PrimitiveArray<Int64Type> = count.as_primitive();
-            substr_index_general::<Int32Type, _, _>(
+            substr_index_general(
                 string_array,
                 delimiter_array,
                 count_array,
+                GenericStringBuilder::<i32>::with_capacity(
+                    string_array.len(),
+                    string_array.value_data().len(),

Review Comment:
   Here and below, this over-allocates the buffer capacity for sliced arrays.



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