arrow::array

Function new_empty_array

pub fn new_empty_array(data_type: &DataType) -> Arc<dyn Array>
Expand description

Creates a new empty array

use std::sync::Arc;
use arrow_schema::DataType;
use arrow_array::{ArrayRef, Int32Array, new_empty_array};

let empty_array = new_empty_array(&DataType::Int32);
let array: ArrayRef = Arc::new(Int32Array::from(vec![] as Vec<i32>));

assert_eq!(&array, &empty_array);