Create a new [`DictionaryArray`] without performing validation # Safety Safe provided [`Self::try_new`] would not return an error
(keys: PrimitiveArray<K>, values: ArrayRef)
| 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) { |