mod array;
pub use array::{StructArrayTypeFields, UnionArrayTypeFields};
mod bitmap;
pub mod buffer;
pub trait Array: crate::array::Array + Sized {
type Array: arrow_array::Array;
fn as_field(name: &str) -> arrow_schema::Field;
fn data_type() -> arrow_schema::DataType;
}
pub trait LogicalArrayType<T>: crate::logical::LogicalArrayType<T>
where
Self: crate::array::ArrayType<Self>,
Option<Self>: crate::array::ArrayType<Self>,
{
type ExtensionType: arrow_schema::extension::ExtensionType;
#[must_use]
fn extension_type() -> Option<Self::ExtensionType> {
None
}
}
#[derive(Debug, Clone, Copy)]
pub struct NoExtensionType;
impl arrow_schema::extension::ExtensionType for NoExtensionType {
const NAME: &'static str = "";
type Metadata = ();
fn metadata(&self) -> &Self::Metadata {
panic!("should not be used")
}
fn serialize_metadata(&self) -> Option<String> {
panic!("should not be used")
}
fn deserialize_metadata(
_metadata: Option<&str>,
) -> Result<Self::Metadata, arrow_schema::ArrowError> {
panic!("should not be used")
}
fn supports_data_type(
&self,
_data_type: &arrow_schema::DataType,
) -> Result<(), arrow_schema::ArrowError> {
panic!("should not be used")
}
fn try_new(
_data_type: &arrow_schema::DataType,
_metadata: Self::Metadata,
) -> Result<Self, arrow_schema::ArrowError> {
panic!("should not be used")
}
}
pub trait Offset: crate::offset::Offset {
const LARGE: bool;
}
impl Offset for i32 {
const LARGE: bool = false;
}
impl Offset for i64 {
const LARGE: bool = true;
}