Skip to content

[Variant] Configure explicit shredding when writing Parquet #11950

Open

Description

@sdf-jkl

Is your feature request related to a problem or challenge?

Applications such as datafusion-variant want to select a physical layout for Variant columns when writing Parquet—for example, shredding event.service as Utf8 and event.status as Int64.

This is already possible by calling shred_variant, constructing a RecordBatch with the resulting storage arrays and Variant fields, and passing it to ArrowWriter. Each application must coordinate the transformation, output schema, and metadata itself. Writer-level configuration or a reusable writer adapter would make this easier.

Describe the solution you'd like

Provide a way to associate an explicit shredding schema with a Variant column and write batches containing the original Variant arrays. For example, the caller could supply a logical target DataType built with ShreddedSchemaBuilder; the exact API is open for discussion.

The integration should reuse the existing shredding kernels, derive the corresponding output schema and Variant metadata, and use the selected layout consistently across batches in a file. Unselected fields and incompatible values should remain in the residual Variant data, preserving logical values and null semantics.

Keep the current behavior when no configuration is supplied. Define the policy for already-shredded input, since shred_variant currently rejects it; changing layouts may require unshred_variant first.

Automatic schema selection from sampled data is separate work.

Describe alternatives you've considered

Additional context

Activity

  1. added
    enhancement
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions