Skip to content

[Variant] VariantArray field API naming#10124

Open
sdf-jkl wants to merge 1 commit into
apache:mainfrom
sdf-jkl:variant-api-rename
Open

[Variant] VariantArray field API naming#10124
sdf-jkl wants to merge 1 commit into
apache:mainfrom
sdf-jkl:variant-api-rename

Conversation

@sdf-jkl

@sdf-jkl sdf-jkl commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

check issue

What changes are included in this PR?

  • Rename existing _field APIs that return &ArrayRef to _column
  • Add new _field APIs that return &FieldRef and tests for them

Are these changes tested?

  • Yes, unit tests

Are there any user-facing changes?

  • Yes, breaking API name change.

@github-actions github-actions Bot added the parquet-variant parquet-variant* crates label Jun 11, 2026
self.shredding_state.typed_value_column()
}

/// Return the [`FieldRef`] of the `metadata` column of the [`StructArray`]

@sdf-jkl sdf-jkl Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now that I look at it the new _field APIs would only be used for tests in #10015.

  // before reuse StructArray::field_by_name (#10110), returns Option<&FieldRef>
  let typed_value_field = variant_array.inner().field_by_name("typed_value").unwrap();
  
  // new — the new VariantArray sugar, returns Option<&FieldRef> (no .inner(), no magic string)
  let typed_value_field = variant_array.typed_value_field().unwrap();

Is it worth introducing for 4 calls in tests?

@sdf-jkl

sdf-jkl commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

@alamb @scovich @klion26 PTAL

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] VariantArray field API naming

1 participant