Module arrow::compute::kernels::cast [−][src]
Expand description
Defines cast kernels for ArrayRef
, to convert Array
s between
supported datatypes.
Example:
use arrow::array::*; use arrow::compute::cast; use arrow::datatypes::DataType; use std::sync::Arc; let a = Int32Array::from(vec![5, 6, 7]); let array = Arc::new(a) as ArrayRef; let b = cast(&array, &DataType::Float64).unwrap(); let c = b.as_any().downcast_ref::<Float64Array>().unwrap(); assert_eq!(5.0, c.value(0)); assert_eq!(6.0, c.value(1)); assert_eq!(7.0, c.value(2));
Structs
CastOptions | CastOptions provides a way to override the default cast behaviors |
Constants
DEFAULT_CAST_OPTIONS |
Functions
can_cast_types | Return true if a value of type |
cast | Cast |
cast_with_options | Cast |