Skip to content

GH-3792: Bind parquet fields to Avro names before aliases - #3793

Open
nastra wants to merge 1 commit into
apache:masterfrom
nastra:avro-alias
Open

nastra wants to merge 1 commit into
apache:masterfrom
nastra:avro-alias

Conversation

@nastra

@nastra nastra commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

This makes sure that the actual Avro field name is considered before looking at aliases.

Fixes #3792

What changes are included in this PR?

Are these changes tested?

yes

Are there any user-facing changes?

no


private Schema.Field getAvroField(String parquetFieldName) {
Schema.Field avroField = avroSchema.getField(parquetFieldName);
if (avroField != null) {

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.

this also aligns with how AvroRecordConverter does it. I also checked other places in the codebase and that seems to be the only one affected

import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

public class TestAvroFieldNameAndAlias {

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.

there wasn't a good fit for this in existing tests, so I decided to create a separate class

@nastra

nastra commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@Fokko @wgtmac please take a look when you get a chance

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.

AvroIndexedRecordConverter resolves aliases before the exact field name

1 participant