Skip to content

fix(arrow/extensions): use canonical Variant extension name - #1241

Open
dgvj-work wants to merge 1 commit into
apache:mainfrom
dgvj-work:fix/variant-extension-name
Open

fix(arrow/extensions): use canonical Variant extension name#1241
dgvj-work wants to merge 1 commit into
apache:mainfrom
dgvj-work:fix/variant-extension-name

Conversation

@dgvj-work

@dgvj-work dgvj-work commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

The canonical Variant extension type name is arrow.parquet.variant. arrow-go still writes parquet.variant, which predates apache/arrow#47456. That makes Variant IPC unreadable by other Arrow implementations, and vice versa.

C++ already made this change in apache/arrow#49082.

Fixes #1203

What changes are included in this PR?

  • VariantType.ExtensionName() now returns arrow.parquet.variant
  • Keep parquet.variant registered so older arrow-go IPC still deserializes as VariantType
  • Parquet schema conversion recognizes both names

Are these changes tested?

  • go test ./arrow/extensions
  • go test ./parquet/pqarrow -run 'TestConvertSchemaParquetVariant|TestShreddedVariantSchema'

Are there any user-facing changes?

Yes — newly written IPC/Flight metadata uses arrow.parquet.variant. Existing parquet.variant data still reads.

Arrow requires arrow.parquet.variant. Keep parquet.variant registered so
older IPC still deserializes.

Fixes apache#1203

Signed-off-by: Digvijay <digvijay.vaghela@yahoo.com>

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The legacy Variant compatibility path works when reading old IPC data, but ToParquet can now panic for the newly registered legacy extension type.

The name-based predicate accepts parquet.variant, after which the code asserts that the value is the canonical *extensions.VariantType. A schema containing the registry-returned legacy type therefore panics instead of returning an error. Details are inline.

Targeted extension, IPC, pqarrow, race, and vet tests otherwise pass. This head currently has no CI results.


This review was drafted by an AI-assisted tool and
confirmed by an Apache Arrow Go maintainer. After you've
addressed the points above and pushed an update, an Apache Arrow Go
maintainer — a real person — will take the next look
at the PR. The findings cite the project's review criteria;
if you think one of them is mis-applied, please reply on the
PR and a maintainer will weigh in.

More on how Apache Arrow Go handles maintainer review:
CONTRIBUTING.md.

Comment thread parquet/pqarrow/schema.go
extType := field.Type.(arrow.ExtensionType)
if extType.ExtensionName() == "parquet.variant" {
if extensions.IsVariantExtensionName(extType.ExtensionName()) {
return variantToNode(extType.(*extensions.VariantType), field, props, arrprops)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

arrow.GetExtensionType("parquet.variant") now returns *extensions.legacyVariantType. The new name predicate accepts that type, but this unconditional assertion to *extensions.VariantType panics. ToParquet should return an error for unsupported wrappers or normalize compatible legacy storage through NewVariantType, rather than asserting based only on the extension name. Please add a regression test using the registry-returned legacy type.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Parquet] Incorrect Variant extension type name

2 participants