Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
fix: slice values in list to fixed-size list cast (#1544)
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp authored Aug 19, 2023
1 parent 5720d9a commit 7edf5f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/compute/cast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ fn cast_list_to_fixed_size_list<O: Offset>(
"incompatible offsets in source list".to_string(),
)),
None => {
let new_values = cast(list.values().as_ref(), inner.data_type(), options)?;
let sliced_values = list.values().sliced(
list.offsets().first().to_usize(),
list.offsets().range().to_usize(),
);
let new_values = cast(sliced_values.as_ref(), inner.data_type(), options)?;
Ok(FixedSizeListArray::new(
DataType::FixedSizeList(Box::new(inner.clone()), size),
new_values,
Expand Down

0 comments on commit 7edf5f9

Please sign in to comment.