diff --git a/datafusion/common/src/cast.rs b/datafusion/common/src/cast.rs index 15c95056ccde..bb9d80996571 100644 --- a/datafusion/common/src/cast.rs +++ b/datafusion/common/src/cast.rs @@ -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 @@ -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))