Function arrow_array::array::new_null_array
source · pub fn new_null_array(data_type: &DataType, length: usize) -> ArrayRef
Expand description
Creates a new array of data_type
of length length
filled
entirely of NULL
values
use std::sync::Arc;
use arrow_schema::DataType;
use arrow_array::{ArrayRef, Int32Array, new_null_array};
let null_array = new_null_array(&DataType::Int32, 3);
let array: ArrayRef = Arc::new(Int32Array::from(vec![None, None, None]));
assert_eq!(&array, &null_array);