Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
datafusion::common::arrow::compute::kernels::cast - Rust
[go: Go Back, main page]

Module cast

Source
Expand description

Cast kernels to convert ArrayRef between supported datatypes.

See cast_with_options for more information on specific conversions.

Example:

// int32 to float64
let a = Int32Array::from(vec![5, 6, 7]);
let b = cast(&a, &DataType::Float64).unwrap();
let c = b.as_primitive::<Float64Type>();
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

Functions§

can_cast_types
Return true if a value of type from_type can be cast into a value of to_type.
cast
Cast array to the provided data type and return a new Array with type to_type, if possible.
cast_with_options
Try to cast array to to_type if possible.