Skip to content

Conversation

@Gezi-lzq
Copy link
Contributor

@Gezi-lzq Gezi-lzq commented Nov 19, 2025

Confluent Schema Registry currently suppresses Avro’s default-value validation (see (confluentinc/schema-registry#1687)), which means even schemas such as {"name":"f_v2","type":"string","default":null} slip through unchecked (confluentinc/schema-registry#2213). If we rebuilt those fields via new Schema.Field(...), Avro would revalidate and reject them, diverging from what the registry already accepted. (AutoMQ/automq-labs#100 (comment) & #3006)

By constructing fields with Accessor.createField(...), we reuse the existing schema object (so logical types stay intact) while bypassing the costly validation step; this keeps the hot path efficient and, more importantly, aligns our behavior with the registry’s current tolerance. If we ever need the original field’s custom props or aliases, we can still copy them after the accessor call.

@superhx superhx merged commit 0db45b8 into main Nov 20, 2025
6 checks passed
@superhx superhx deleted the chore/avro-field branch November 20, 2025 03:27
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.

3 participants