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

Method new_unchecked

arrow-array/src/array/dictionary_array.rs:332–348  ·  view source on GitHub ↗

Create a new [`DictionaryArray`] without performing validation # Safety Safe provided [`Self::try_new`] would not return an error

(keys: PrimitiveArray<K>, values: ArrayRef)

Source from the content-addressed store, hash-verified

330 ///
331 /// Safe provided [`Self::try_new`] would not return an error
332 pub unsafe fn new_unchecked(keys: PrimitiveArray<K>, values: ArrayRef) -> Self {
333 if cfg!(feature = "force_validate") {
334 return Self::new(keys, values);
335 }
336
337 let data_type = DataType::Dictionary(
338 Box::new(keys.data_type().clone()),
339 Box::new(values.data_type().clone()),
340 );
341
342 Self {
343 data_type,
344 keys,
345 values,
346 is_ordered: false,
347 }
348 }
349
350 /// Deconstruct this array into its constituent parts
351 pub fn into_parts(self) -> (PrimitiveArray<K>, ArrayRef) {

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.45
data_typeMethod · 0.45

Tested by

no test coverage detected