MCPcopy Create free account
hub / github.com/apache/arrow-rs / new_empty_array

Function new_empty_array

arrow-array/src/array/mod.rs:1002–1005  ·  view source on GitHub ↗

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 )); assert_eq!(&array, &empty_array); ```

(data_type: &DataType)

Source from the content-addressed store, hash-verified

1000/// assert_eq!(&array, &empty_array);
1001/// ```
1002pub fn new_empty_array(data_type: &DataType) -> ArrayRef {
1003 let data = ArrayData::new_empty(data_type);
1004 make_array(data)
1005}
1006
1007/// Creates a new array of `data_type` of length `length` filled
1008/// entirely of `NULL` values

Callers 15

decode_columnFunction · 0.85
filter_arrayFunction · 0.85
extract_denseFunction · 0.85
interleaveFunction · 0.85
interleave_run_endFunction · 0.85
take_implFunction · 0.85
merge_nFunction · 0.85
consume_batchMethod · 0.85
consume_batchMethod · 0.85
consume_batchMethod · 0.85

Calls 1

make_arrayFunction · 0.70

Tested by 10

roundtrip_emptyFunction · 0.68
test_run_array_emptyFunction · 0.68
test_run_array_eq_emptyFunction · 0.68
test_empty_primitiveFunction · 0.68