pub trait ToArrowFn<A> {
// Required method
fn to_arrow(
&self,
array: A,
data_type: &DataType,
) -> VortexResult<Option<ArrowArrayRef>>;
// Provided method
fn preferred_arrow_data_type(
&self,
_array: A,
) -> VortexResult<Option<DataType>> { ... }
}
Expand description
Trait for Arrow conversion compute function.
Required Methods§
Sourcefn to_arrow(
&self,
array: A,
data_type: &DataType,
) -> VortexResult<Option<ArrowArrayRef>>
fn to_arrow( &self, array: A, data_type: &DataType, ) -> VortexResult<Option<ArrowArrayRef>>
Convert the array to an Arrow array of the given type.
Implementation can return None if the conversion cannot be specialized by this encoding.
In this case, the default conversion via to_canonical
will be used.
Provided Methods§
Sourcefn preferred_arrow_data_type(&self, _array: A) -> VortexResult<Option<DataType>>
fn preferred_arrow_data_type(&self, _array: A) -> VortexResult<Option<DataType>>
Return the preferred Arrow DataType
of the encoding, or None of the canonical
DataType
for the array’s Vortex vortex_dtype::DType
should be used.