Skip to content

[Variant] Remove ceremony of going from list of Variant to VariantArray #8606

@friendlymatthew

Description

@friendlymatthew

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

Creating a VariantArray from a collection of Variant values currently requires a fair amount of boilerplate when the intent is simply to convert an iterable of Variant values into a VariantArray

fn foo() {
    let mut b = VariantArrayBuilder::new();
    
    for v in variants {
        b.append_variant(v);
    }
}

Describe the solution you'd like

Implementing a From<Impl IntoIterator<Item = Variant>> for VariantArray would simplify this process and make the API more ergonomic

Additional context

This feature is motivated by datafusion-variant, a higher-level library that integrates with Datafusion through a series of udfs

Metadata

Metadata

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