Is your feature request related to a problem or challenge?
Follow up for #22784 from @Jefffrey's comment
Description
In make_map_batch, when inputs are mixed scalar/array, we expand scalars to arrays via expand_if_scalar -- but the result is still wrapped in ColumnarValue::Array(...). The downstream code then pattern-matches on ColumnarValue variants again, even though the non-const path is guaranteed to be Array at that point.
The function should instead extract raw ArrayRefs once the const/non-const decision is made, and pass those through validation and make_map_batch_internal eliminating the redundant ColumnarValue wrapping and the confusing redispatch on a variant that can no longer be Scalar.
This would simplify the control flow and make the invariants clearer, but touches make_map_batch_internal, get_first_array_ref, and the key validation dispatch.
Is your feature request related to a problem or challenge?
Follow up for #22784 from @Jefffrey's comment
Description
In
make_map_batch, when inputs are mixed scalar/array, we expand scalars to arrays viaexpand_if_scalar-- but the result is still wrapped inColumnarValue::Array(...). The downstream code then pattern-matches onColumnarValuevariants again, even though the non-const path is guaranteed to beArrayat that point.The function should instead extract raw
ArrayRefs once the const/non-const decision is made, and pass those through validation andmake_map_batch_internaleliminating the redundantColumnarValuewrapping and the confusing redispatch on a variant that can no longer beScalar.This would simplify the control flow and make the invariants clearer, but touches
make_map_batch_internal,get_first_array_ref, and the key validation dispatch.