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
new_empty_array in datafusion::common::arrow::array - Rust
[go: Go Back, main page]

Function new_empty_array

Source
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);