Skip to content

Commit

Permalink
arrow-cast: Support FixedSizeBinary packing
Browse files Browse the repository at this point in the history
  • Loading branch information
metalmatze committed Oct 31, 2024
1 parent 1621350 commit 8fa2f3c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arrow-cast/src/cast/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,13 @@ pub(crate) fn cast_to_dictionary<K: ArrowDictionaryKeyType>(
}
pack_byte_to_dictionary::<K, GenericBinaryType<i64>>(array, cast_options)
}
FixedSizeBinary(i32) => {
// If the input is a view type, we can avoid casting (thus copying) the data
if array.data_type() == &DataType::FixedSizeBinary(i32) {
return binary_view_to_dictionary::<K, i64>(array);
}
pack_byte_to_dictionary::<K, GenericBinaryType<i64>>(array, cast_options)
}
_ => Err(ArrowError::CastError(format!(
"Unsupported output type for dictionary packing: {dict_value_type:?}"
))),
Expand Down

0 comments on commit 8fa2f3c

Please sign in to comment.