Skip to content

Commit

Permalink
add as_large_binary_array
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Nov 27, 2024
1 parent 0bcb28c commit 9f15a53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions datafusion/common/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ use arrow::{
datatypes::{ArrowDictionaryKeyType, ArrowPrimitiveType},
};
use arrow_array::{
BinaryViewArray, Float16Array, Int16Array, Int8Array, LargeStringArray,
StringViewArray, UInt16Array,
BinaryViewArray, Float16Array, Int16Array, Int8Array, LargeBinaryArray,
LargeStringArray, StringViewArray, UInt16Array,
};

// Downcast ArrayRef to Date32Array
Expand Down Expand Up @@ -265,6 +265,11 @@ pub fn as_binary_view_array(array: &dyn Array) -> Result<&BinaryViewArray> {
Ok(downcast_value!(array, BinaryViewArray))
}

// Downcast ArrayRef to LargeBinaryArray
pub fn as_large_binary_array(array: &dyn Array) -> Result<&LargeBinaryArray> {
Ok(downcast_value!(array, LargeBinaryArray))
}

// Downcast ArrayRef to FixedSizeListArray
pub fn as_fixed_size_list_array(array: &dyn Array) -> Result<&FixedSizeListArray> {
Ok(downcast_value!(array, FixedSizeListArray))
Expand Down

0 comments on commit 9f15a53

Please sign in to comment.