Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use valid schema related to null default based on specification in #442

Conversation

apupier
Copy link
Contributor

@apupier apupier commented Jan 5, 2024

RecordEvolutionTest

during investigation upgrading Avro to 1.9+, the test was failing. the code has enforced the rule from the specification that when a default value is specified for a record field whose type is a union, the type of the default value must match the first element of the union. Thus, for unions containing "null", the "null" is usually listed first, since the default value of such unions is typically null.

it was part of specification in 1.8 already
https://avro.apache.org/docs/1.8.0/spec.html#Unions , just not enforced in the codebase.

relates to #167

RecordEvolutionTest

during investigation upgrading Avro to 1.9+, the test was failing. the
code has enforced the rule from the specification that `when a default
value is specified for a record field whose type is a union, the type of
the default value must match the first element of the union. Thus, for
unions containing "null", the "null" is usually listed first, since the
default value of such unions is typically null.`

it was part of specification in 1.8 already
https://avro.apache.org/docs/1.8.0/spec.html#Unions , just not enforced
in the codebase.

relates to FasterXML#167

Signed-off-by: Aurélien Pupier <[email protected]>
@cowtowncoder
Copy link
Member

Ah! Thank you, yes this is interesting.

@cowtowncoder cowtowncoder merged commit 40d1406 into FasterXML:2.17 Jan 9, 2024
4 checks passed
@apupier apupier deleted the 2.17-useValidSchemaBasedOnSpecificationInRecordEvolutionTest branch January 9, 2024 07:46
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.

2 participants