Jefffrey commented on code in PR #9274:
URL: https://github.com/apache/arrow-rs/pull/9274#discussion_r2749137089


##########
arrow-cast/src/cast/list.rs:
##########
@@ -191,3 +347,151 @@ pub(crate) fn cast_list<I: OffsetSizeTrait, O: 
OffsetSizeTrait>(
         nulls,
     )?))
 }
+
+/// Casting list view arrays to list.
+pub(crate) fn cast_list_view_to_list<I, O>(
+    array: &dyn Array,
+    to: &FieldRef,
+    cast_options: &CastOptions,
+) -> Result<ArrayRef, ArrowError>
+where
+    I: OffsetSizeTrait,
+    // We need ArrowPrimitiveType here to be able to create indices array for 
the
+    // take kernel.
+    O: ArrowPrimitiveType,
+    O::Native: OffsetSizeTrait,
+{
+    let list_view = array.as_list_view::<I>();
+    let list_view_offsets = list_view.offsets();
+    let sizes = list_view.sizes();
+
+    let mut take_indices: Vec<O::Native> = 
Vec::with_capacity(list_view.values().len());

Review Comment:
   I do wonder how hard we should cater for weird cases like nesting REE within 
a List 🤔
   
   That would likely cause issues with other code paths I'd imagine



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

Reply via email to