Helper function to create MapArray from array of values to support arrays for Map scalar function ``` text Format of input KEYS and VALUES column keys values +---------------------+ +---------------------+ | +-----------------+ | | +-----------------+ | | | [k11, k12, k13] | | | | [v11, v12, v13] | | | +-----------------+ | | +-----------------+ | |
(
keys: &ArrayRef,
values: &ArrayRef,
)
| 475 | /// +-----------+ +-----------+ |
| 476 | /// ```text |
| 477 | fn make_map_array_internal<O: OffsetSizeTrait>( |
| 478 | keys: &ArrayRef, |
| 479 | values: &ArrayRef, |
| 480 | ) -> Result<ColumnarValue> { |
| 481 | // Save original data types and array length before list_to_arrays transforms them |
| 482 | let keys_data_type = keys.data_type().clone(); |
| 483 | let values_data_type = values.data_type().clone(); |
| 484 | let original_len = keys.len(); // This is the number of rows in the input |
| 485 | |
| 486 | // Save the nulls bitmap from the original keys array (before list_to_arrays) |
| 487 | // This tells us which MAP values are NULL (not which keys within maps are null) |
| 488 | let nulls_bitmap = keys.nulls().cloned(); |
| 489 | |
| 490 | let keys = list_to_arrays::<O>(keys); |
| 491 | let values = list_to_arrays_skipping_null_rows::<O>(values, nulls_bitmap.as_ref()); |
| 492 | |
| 493 | build_map_array( |
| 494 | &keys, |
| 495 | &values, |
| 496 | &keys_data_type, |
| 497 | &values_data_type, |
| 498 | original_len, |
| 499 | nulls_bitmap, |
| 500 | ) |
| 501 | } |
| 502 | |
| 503 | /// Helper function specifically for FixedSizeList inputs |
| 504 | /// Similar to make_map_array_internal but uses fixed_size_list_to_arrays instead of list_to_arrays |
nothing calls this directly
no test coverage detected
searching dependent graphs…