Skip to content

[Variant] variant_get(..., List<_>) non-Struct types support #9615

@sdf-jkl

Description

@sdf-jkl

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

While working on #9599 @scovich and I noticed that variant_get(..., List<Int64>) returns a shredded List<Struct{value, typed_value:Int64}> instead of List<Int64>
#9599 (comment)

I believe the newly added test_variant_get_list_like_unsafe_cast_preserves_null_elements unit test confirms the wrong behavior:
Caller passes DataType::List(Arc::new(Field::new("item", DataType::Int64, true))) (= List)
But the test expects List<Struct{value, typed_value:Int64}> (= shredded variant array)

Describe the solution you'd like
Make VariantToListArrowRowBuilder build arrays depending on the requested output type, not just shredded struct.

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions