Skip to content

fix(avro): error on complex (non-nullable) unions instead of silently dropping (#777)#808

Open
SAY-5 wants to merge 1 commit into
apache:mainfrom
SAY-5:say5-avro-complex-union-777
Open

fix(avro): error on complex (non-nullable) unions instead of silently dropping (#777)#808
SAY-5 wants to merge 1 commit into
apache:mainfrom
SAY-5:say5-avro-complex-union-777

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 10, 2026

Rationale for this change

Fixes #777. ArrowSchemaFromAvro previously silently dropped non-nullable Avro unions (e.g. ["int","string"]) in both arrowSchemafromAvro and iterateFields. Output schemas were missing fields with no warning to the caller.

What changes are included in this PR?

Panic with a clear error message at the two case "union" / case *avro.UnionSchema arms when the union is not a simple nullable. The package's existing recover() in ArrowSchemaFromAvro converts this into a returned error.

Are these changes tested?

Yes, TestComplexUnionReportsError exercises a record with ["int","string"] and asserts a non-nil error mentioning union.

Are there any user-facing changes?

Callers that previously received an incomplete schema for a complex-union field now get an explicit error.

… dropping (apache#777)

Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>
@SAY-5 SAY-5 requested a review from zeroshade as a code owner May 10, 2026 23:26
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.

[Avro] Silently ignores complex unions

1 participant