jorgecarleitao commented on a change in pull request #9402:
URL: https://github.com/apache/arrow/pull/9402#discussion_r576411810
##########
File path: rust/arrow/src/compute/kernels/cast.rs
##########
@@ -292,6 +343,30 @@ pub fn cast(array: &ArrayRef, to_type: &DataType) ->
Result<ArrayRef> {
Ok(list_array)
}
+ (_, LargeList(ref to)) => {
+ // cast primitive to list's primitive
+ let cast_array = cast(array, to.data_type())?;
+ // create offsets, where if array.len() = 2, we have [0,1,2]
+ let offsets: Vec<i64> = (0..=array.len() as i64).collect();
+ let value_offsets = Buffer::from_slice_ref(&offsets);
+ let list_data = ArrayData::new(
+ to.data_type().clone(),
+ array.len(),
+ Some(cast_array.null_count()),
+ cast_array
+ .data()
+ .null_bitmap()
+ .clone()
Review comment:
Same here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]