diff --git a/datafusion/common/src/cast.rs b/datafusion/common/src/cast.rs index 93bb82b6b795..15c95056ccde 100644 --- a/datafusion/common/src/cast.rs +++ b/datafusion/common/src/cast.rs @@ -37,7 +37,8 @@ use arrow::{ datatypes::{ArrowDictionaryKeyType, ArrowPrimitiveType}, }; use arrow_array::{ - BinaryViewArray, Float16Array, Int16Array, Int8Array, StringViewArray, UInt16Array, + BinaryViewArray, Float16Array, Int16Array, Int8Array, LargeStringArray, + StringViewArray, UInt16Array, }; // Downcast ArrayRef to Date32Array @@ -130,6 +131,11 @@ pub fn as_string_view_array(array: &dyn Array) -> Result<&StringViewArray> { Ok(downcast_value!(array, StringViewArray)) } +// Downcast ArrayRef to LargeStringArray +pub fn as_large_string_array(array: &dyn Array) -> Result<&LargeStringArray> { + Ok(downcast_value!(array, LargeStringArray)) +} + // Downcast ArrayRef to BooleanArray pub fn as_boolean_array(array: &dyn Array) -> Result<&BooleanArray> { Ok(downcast_value!(array, BooleanArray))