Skip to content

Refactor make_map_batch to avoid wrapping expanded arrays back in ColumnarValue #22833

@nathanb9

Description

@nathanb9

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions