Skip to content

Commit

Permalink
add as_large_string_array
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Nov 27, 2024
1 parent 612a35f commit 0bcb28c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion datafusion/common/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 0bcb28c

Please sign in to comment.