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

Function new_null_array

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

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

(data_type: &DataType, length: usize)

Source from the content-addressed store, hash-verified

1018/// assert_eq!(&array, &null_array);
1019/// ```
1020pub fn new_null_array(data_type: &DataType, length: usize) -> ArrayRef {
1021 make_array(ArrayData::new_null(data_type, length))
1022}
1023
1024/// Helper function that creates an [`OffsetBuffer`] from a buffer and array offset/ length
1025///

Callers 15

test_pretty_format_nullFunction · 0.85
cast_with_optionsFunction · 0.85
cast_from_decimalFunction · 0.85
cast_to_decimalFunction · 0.85
shredded_get_pathFunction · 0.85
newMethod · 0.85
decode_fixed_size_listFunction · 0.85
shiftFunction · 0.85

Calls 1

make_arrayFunction · 0.70