Trait lance::arrow::DataTypeExt
source · pub trait DataTypeExt {
// Required methods
fn is_binary_like(&self) -> bool;
fn is_struct(&self) -> bool;
fn is_fixed_stride(&self) -> bool;
fn is_dictionary(&self) -> bool;
fn byte_width(&self) -> usize;
}
Required Methods§
sourcefn is_binary_like(&self) -> bool
fn is_binary_like(&self) -> bool
Returns true if the data type is binary-like, such as (Large)Utf8 and (Large)Binary.
use lance::arrow::*;
use arrow_schema::DataType;
assert!(DataType::Utf8.is_binary_like());
assert!(DataType::Binary.is_binary_like());
assert!(DataType::LargeUtf8.is_binary_like());
assert!(DataType::LargeBinary.is_binary_like());
assert!(!DataType::Int32.is_binary_like());
sourcefn is_fixed_stride(&self) -> bool
fn is_fixed_stride(&self) -> bool
Check whether the given Arrow DataType is fixed stride.
A fixed stride type has the same byte width for all array elements This includes all PrimitiveType’s Boolean, FixedSizeList, FixedSizeBinary, and Decimals
sourcefn is_dictionary(&self) -> bool
fn is_dictionary(&self) -> bool
Returns true if the DataType is a dictionary type.