Skip to content

AVRO-4215: [java] Convert writer union values once - #4060

Open
hutiefang76 wants to merge 1 commit into
apache:mainfrom
hutiefang76:AVRO-4215-fastreader-conversion
Open

hutiefang76 wants to merge 1 commit into
apache:mainfrom
hutiefang76:AVRO-4215-fastreader-conversion

Conversation

@hutiefang76

Copy link
Copy Markdown

What is the purpose of the change

Fix AVRO-4215. When a writer union resolves to a reader logical type, its selected branch already applies the conversion. Converting the union result again passes a LocalDate to a conversion expecting an Integer. Let the selected branch own the conversion, forwarding any specific-record field conversion to that branch.

Verifying this change

Added regressions for fast and resolving readers, nullable unions, missing registered conversions, and an explicit field conversion counter. On unchanged main, the implicit and explicit conversion cases both failed; all seven tests pass with the patch. The explicit field test invokes FastReaderBuilder directly and verifies one field conversion and zero registered conversions. Each test uses an isolated data model.

The official Java SDK mvn clean test completed successfully across all 26 reactor modules: Surefire reported 4,259 tests, with 8 existing skips and no failures/errors. Tests ran on JDK 17 with the required JDK 11/17/21 toolchains available.

Documentation

No new public API or feature; no documentation change required.

AI assistance: DeepSeek and Codex helped implement, review and validate this patch. This description was AI-generated.

A writer union already converts its selected branch to the reader
logical type. Converting the outer union again can pass a LocalDate
to a conversion expecting an Integer. Let each selected branch own
the conversion, including explicit specific-record field conversions.

Add fast and resolving reader controls, nullable and unconverted
values, and a field conversion counter regression.

Generated-by: DeepSeek (deepseek-v4-flash), Codex
@github-actions github-actions Bot added the Java Pull Requests for Java binding label Oct 23, 2026
@hutiefang76

Copy link
Copy Markdown
Author

The Java tests, Spotless, Rat and CodeQL workflows show action_required with no jobs yet. Could a maintainer approve those runs when convenient?

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

Labels

Java Pull Requests for Java binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant