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
Add support for 64-bit Schema Registry IDs (Id64) in arrow-avro (#8575)
# Which issue does this PR close?
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
- Part of #4886
# Rationale for this change
Many Kafka deployments use **Confluent Schema Registry** (4‑byte,
big‑endian ID) and/or **Apicurio Registry** (commonly 8‑byte, big‑endian
*global* ID). `arrow-avro` already supported the Confluent wire format;
this PR adds first‑class support for Apicurio’s 64‑bit ID, enabling
seamless decode/encode of streams that carry an 8‑byte ID after the
magic byte.
This improves interoperability with ecosystems that standardize on
Apicurio or Red Hat Event Streams.
# What changes are included in this PR?
* **New 64‑bit ID support**
* Add `Fingerprint::Id64(u64)` and `FingerprintAlgorithm::Id64`.
* Add `FingerprintStrategy::Id64(u64)` and helper
`Fingerprint::load_fingerprint_id64`.
* Extend `Fingerprint::serialized_prefix` to emit/read an 8‑byte
big‑endian ID after the `0x00` magic byte.
* **Clarify/algin numeric‑ID algorithm names**
* Replace the prior `FingerprintAlgorithm::None` (numeric ID) with
`FingerprintAlgorithm::Id` (4‑byte) and introduce `Id64` (8‑byte). All
examples and call sites updated accordingly (i.e.,
`SchemaStore::new_with_type(FingerprintAlgorithm::Id)`).
* **Reader/Writer plumbing**
* `Decoder` now understands both `Id` (4‑byte) and `Id64` (8‑byte)
prefixes.
* `WriterBuilder` accepts `FingerprintStrategy::Id64` to write frames
with a 64‑bit ID.
* **SchemaStore behavior**
* `SchemaStore::register` now errors for `Id`/`Id64` algorithms (as
those IDs come from a registry); callers should use
`set(Fingerprint::Id(_)|Id64(_), ...)` to associate schemas by registry
ID.
* **Docs & examples**
* Reader docs expanded to call out Confluent (4‑byte) and Apicurio
(8‑byte) formats; examples switched to `FingerprintAlgorithm::Id`. Bench
and example updates reflect the new variants.
# Are these changes tested?
Yes. This PR adds/updates unit tests that exercise the new path
end‑to‑end, including:
* `test_stream_writer_with_id64_fingerprint_rt` (writer round‑trip with
64‑bit ID).
* `test_two_messages_same_schema_id64` (decoder round‑trip with 64‑bit
ID).
* Adjustments to existing tests and benches to use
`FingerprintAlgorithm::Id` instead of `None`.
# Are there any user-facing changes?
N/A because `arrow-avro` isn't public yet.
---------
Co-authored-by: Matthijs Brobbel <m1brobbel@gmail.com>
0 commit comments