Skip to content

Read shredded variant columns from Parquet #3606

Open

Description

@c-thiel

Is your feature request related to a problem or challenge?

#2880 reads unshredded variant columns from Parquet: a variant group stored as metadata and value binaries. A projected variant whose group contains a typed_value field fails with FeatureUnsupported ("Reading shredded variant column v (field id N) is not supported yet").

Iceberg v3 allows writers to shred variants following the Parquet variant shredding spec. iceberg-java can write such files (write.parquet.shred-variants, off by default) and reads them. Tables containing shredded files are unreadable from iceberg-rust today if a query projects a shredded variant.

Unprojected shredded variants do not block reads of other columns.

Describe the solution you'd like

Read shredded variant groups and return each row's variant, as the unshredded path does today.

Requirements from the shredding spec:

  • Rebuild each row from value and typed_value, following the spec's rules for which of the two holds the row (including null and missing values).
  • Partially shredded objects: merge the fields in typed_value with the fields still encoded in value.
  • Shredded arrays and nested shredded objects, recursively.
  • Shredded primitive types mapped to their variant encodings (decimals, timestamps, UUID, etc.).
  • Match the columns inside a variant group by name, since they carry no field ids.

arrow-rs provides unshred_variant in parquet-variant-compute, which folds typed_value back into value. Using it would add that crate as a dependency.

Related: #2411 (v3 tracking), #2880 (unshredded read). Reference implementation in iceberg-go: apache/iceberg-go#986.

Willingness to contribute

None

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