You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Rafal Kluszczynski <ra...@allegrogroup.com> on 2017/04/10 07:29:00 UTC
Why canonical form excludes default?
Hello,
I have a question about canonical form. So far, we are storing schemas in schema-registry service. Usually this mean, that developers use different schema versions on dev, test or production environments. That is why we were interested in using fingerprint as unique schema identifier for particular version (the same on every env).
This, of course, mean we have to adapt schema-registry and that is OK for us. Unfortunately, default is also stripped from original schema which in our case is important for such tools like Hue or Presto.
Could you explain why default value is stripped and what is the basic idea behind fingerprint and canonical form in current version of Avro specification (1.8.1)?
Kind regards,
--
// Rafal Kluszczynski
Software Engineer
Allegro
Re: Why canonical form excludes default?
Posted by Doug Cutting <cu...@gmail.com>.
Identical fingerprints indicate that one schema can read data written
by another without schema resolution. Canonical form is used to
implement fingerprints. Default values are used during resolution,
and are thus not a part of fingerprints.
Compatibility between schemas that takes account of schema resolution
can be determined with utilities like Java's SchemaCompatibility and
SchemaValidator classes. This type of compatibility requires a more
complex comparison, not implementable with hashcode identity.
Doug
On Mon, Apr 10, 2017 at 12:29 AM, Rafal Kluszczynski
<ra...@allegrogroup.com> wrote:
> Hello,
>
> I have a question about canonical form. So far, we are storing schemas in schema-registry service. Usually this mean, that developers use different schema versions on dev, test or production environments. That is why we were interested in using fingerprint as unique schema identifier for particular version (the same on every env).
>
> This, of course, mean we have to adapt schema-registry and that is OK for us. Unfortunately, default is also stripped from original schema which in our case is important for such tools like Hue or Presto.
>
> Could you explain why default value is stripped and what is the basic idea behind fingerprint and canonical form in current version of Avro specification (1.8.1)?
>
> Kind regards,
>
> --
> // Rafal Kluszczynski
>
> Software Engineer
> Allegro
>