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


##########
datafusion/functions/src/unicode/common.rs:
##########
@@ -119,83 +120,125 @@ pub(crate) fn general_left_right<F: LeftRightSlicer>(
     }
 }
 
-/// `general_left_right` implementation for strings
-fn general_left_right_array<
-    'a,
-    T: OffsetSizeTrait,
-    V: ArrayAccessor<Item = &'a str>,
-    F: LeftRightSlicer,
->(
-    string_array: V,
+/// Returns true if all offsets in the array fit in u32, meaning the values
+/// buffer can be referenced by StringView's u32 offset field.
+fn values_fit_in_u32<T: OffsetSizeTrait>(string_array: &GenericStringArray<T>) 
-> bool {
+    string_array
+        .offsets()
+        .last()
+        .map(|offset| offset.as_usize() <= u32::MAX as usize)

Review Comment:
   Well that's confusing :) Fixed, thanks for spotting!



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