Skip to content

[Variant] Support list paths in ShreddedSchemaBuilder - #10635

Open
cakeni wants to merge 1 commit into
apache:mainfrom
cakeni:feat/variant-schema-list-paths
Open

[Variant] Support list paths in ShreddedSchemaBuilder#10635
cakeni wants to merge 1 commit into
apache:mainfrom
cakeni:feat/variant-schema-list-paths

Conversation

@cakeni

@cakeni cakeni commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

ShreddedSchemaBuilder can already parse indexed Variant paths, and core Variant shredding supports lists, but schema construction currently panics when a path reaches an index. This prevents callers from describing list element schemas through the builder.

What changes are included in this PR?

  • Add a list node to the builder's intermediate schema tree.
  • Treat numeric indexes as references to the shared list element schema, including for nested lists.
  • Document the index behavior and add coverage for list-of-struct and nested-list schemas.
  • Build the existing list shredding test schema through ShreddedSchemaBuilder.

Are these changes tested?

Yes. cargo test -p parquet-variant-compute test_variant_schema_builder passes (11 tests).

Are there any user-facing changes?

Yes. Callers can now use indexed paths such as items[0].id when constructing shredding schemas. This is backward compatible.

@github-actions github-actions Bot added the parquet-variant parquet-variant* crates label Aug 11, 2026
@cakeni
cakeni marked this pull request as ready for review August 11, 2026 13:30

@sdf-jkl sdf-jkl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cakeni, looks good to me.

I have an open question I'd like to discuss before pushing this forward.

@klion26 @scovich

Comment on lines +2916 to +2918
let shredding_type = ShreddedSchemaBuilder::default()
.with_path("items[0].id", &DataType::Int64)?
.with_path("items[42].name", &DataType::Utf8)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still wonder if we should allow number other than 0 or allow numbers at all. I guess it's an open question.

I like the jsonpath style with [*] - https://www.rfc-editor.org/rfc/rfc9535.html#section-2.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet-variant parquet-variant* crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Variant] Support list paths in ShreddedSchemaBuilder

2 participants