Repository navigation
feat: Support fixed as type for uuid - #339
Merged
Merged
Conversation
martin-g
reviewed
Nov 23, 2025
martin-g
reviewed
Nov 23, 2025
martin-g
reviewed
Dec 8, 2025
Contributor
Author
|
I think this is ready to merge now |
fixed as type for uuidfixed as type for uuid
Contributor
Author
|
I've rebased this PR on main |
Contributor
Author
martin-g
reviewed
Dec 18, 2025
Kriskras99
force-pushed
the
uuid
branch
2 times, most recently
from
December 18, 2025 14:24
bbd66d7 to
86b4128
Compare
Contributor
Author
|
All feedback has been resolved @martin-g |
martin-g
reviewed
Dec 22, 2025
martin-g
reviewed
Dec 22, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds official support for the fixed type as an underlying type for the uuid logical type, aligning with Avro 1.12 specification. The changes maintain backward compatibility with the legacy bytes encoding used in versions 0.21.0 and earlier.
Key changes:
- Introduces
UuidSchemaenum to supportstring,fixed, and legacybytesvariants for UUID - Refactors
Schema::Decimalto useInnerDecimalSchemaenum instead ofBox<Schema>, reducing memory overhead - Updates encoding, decoding, validation, and compatibility logic across all UUID variants
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| avro/src/schema.rs | Adds UuidSchema and InnerDecimalSchema enums; updates schema parsing, serialization, and name resolution |
| avro/src/encode.rs | Updates encoding logic for all UUID variants and decimal with new inner schema |
| avro/src/decode.rs | Updates decoding logic for all UUID variants and decimal with new inner schema |
| avro/src/types.rs | Updates value validation and resolution for UUID and decimal variants |
| avro/src/schema_equality.rs | Adds equality comparison for UUID and decimal variant combinations |
| avro/src/schema_compatibility.rs | Implements compatibility checks for UUID variants in reader/writer schemas |
| avro/src/serde/ser_schema.rs | Updates schema-aware serialization for UUID and decimal variants |
| avro/tests/serde_human_readable_true.rs | Renames test and updates from fixed to string UUID type |
| avro/tests/serde_human_readable_false.rs | Updates comment and assertion for fixed UUID encoding |
| avro/src/writer.rs | Updates decimal test cases to use new InnerDecimalSchema |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
All feedback has been resolved @martin-g (including copilot feedback) |
martin-g
approved these changes
Dec 22, 2025
Contributor
Author
|
Thank you for all the work in reviewing this! |
KitFieldhouse
added a commit
to KitFieldhouse/avro-rs
that referenced
this pull request
Jan 14, 2026
…schemata from pull apache#339
Closed
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.
In Avro 1.12 official support for the
fixedtype was added for the logical typeuuid. avro-rs had a different interpretation of that and would rewrite it to abytestype.To remain compatible with the legacy implementation, avro-rs now supports
string,fixed, andbytes.bytesdoes not match spec, but does allow users to read already encoded data.This is a severe breaking change, although only for people who only use avro-rs (the legacy encoding did not, and still does not work with other languages).
I've also reworked
Schema::Decimalto use a similar setup asSchema::Uuidwhich saves aBoxand does not make the type bigger.