You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Name and Namespace fields for Schema::Duration #378
Should Schema::Duration contain a FixedSchema like other logical types that can use fixed as the underlying type like Schema::Decimal and Schema::Uuid? It can almost do without, since the fixed type's size is required to be 12 for the duration logical type, but it seems we still need a place to store name and namespace, otherwise that information will be lost at parsing time.
I'm happy to submit a PR for this, just wanted to check in case there's a reason Duration doesn't contain a FixedSchema already.
Sounds good! I've been playing with some changes for this, so I'll get those together in a PR and include changes to is_named, too.
As far as is_named is concerned, would you be opposed to deprecating (or simply removing) SchemaKind::is_named, and having is_named implemented directly on the Schema enum type instead? It looks like it would be difficult to implement SchemaKind::is_named correctly for logical types like Decimal, where the underlying type could be fixed (which is named) or bytes (which is not,) since underlying type information is not included in SchemaKind.
Activity
martin-g commentedon Dec 29, 2025
No reason!
We just merged #339 with improvements to DecimalSchema and UuidSchema related to this. We should do the same for Schema::Duration too!
We should also add support for all of them at
avro-rs/avro/src/schema.rs
Line 179 in 8d6dd77
jdarais commentedon Dec 29, 2025
Sounds good! I've been playing with some changes for this, so I'll get those together in a PR and include changes to
is_named, too.As far as
is_namedis concerned, would you be opposed to deprecating (or simply removing)SchemaKind::is_named, and havingis_namedimplemented directly on theSchemaenum type instead? It looks like it would be difficult to implementSchemaKind::is_namedcorrectly for logical types likeDecimal, where the underlying type could befixed(which is named) orbytes(which is not,) since underlying type information is not included inSchemaKind.martin-g commentedon Dec 29, 2025
Sure!
martin-g commentedon Jan 8, 2026
This has been fixed with #382