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

Method from

arrow-array/src/array/primitive_array.rs:1179–1186  ·  view source on GitHub ↗
(array: PrimitiveArray<T>)

Source from the content-addressed store, hash-verified

1177
1178impl<T: ArrowPrimitiveType> From<PrimitiveArray<T>> for ArrayData {
1179 fn from(array: PrimitiveArray<T>) -> Self {
1180 let builder = ArrayDataBuilder::new(array.data_type)
1181 .len(array.values.len())
1182 .nulls(array.nulls)
1183 .buffers(vec![array.values.into_inner()]);
1184
1185 unsafe { builder.build_unchecked() }
1186 }
1187}
1188
1189/// SAFETY: Correctly implements the contract of Arrow Arrays

Callers

nothing calls this directly

Calls 5

buffersMethod · 0.45
nullsMethod · 0.45
lenMethod · 0.45
build_uncheckedMethod · 0.45
into_partsMethod · 0.45

Tested by

no test coverage detected