Repository navigation
AVRO-4215: [java] Convert writer union values once - #4060
Open
hutiefang76 wants to merge 1 commit into
Open
hutiefang76 wants to merge 1 commit into
hutiefang76 wants to merge 1 commit into
Conversation
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
Author
|
The Java tests, Spotless, Rat and CodeQL workflows show |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 testcompleted 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.