Hi,

I'm just contemplating an implementation of the decimal logical type, and
I'm a bit confused by the specification around this.

On the one hand the specification says
<https://avro.apache.org/docs/1.9.1/spec.html#Parsing+Canonical+Form+for+Schemas>
:

If the Parsing Canonical Forms of two different schemas are textually
> equal, then those schemas are "the same" as far as any reader is concerned


but on the other, when discussing the decimal logical type, it says:

For the purposes of schema resolution, two schemas that are decimal logical
> types *match* if their scales and precisions match.


I'm not sure how to reconcile those two statements. If two schemas with
mismatched scales or precisions should be considered to be mismatched for
schema resolution, then I'm not sure how the first statement could be
considered true, as surely mismatched schemas are something that a reader
should be concerned about?

Given that the spec recommends using the canonical form for schema
fingerprints, ISTM there might be some possibility for attack (or at least
data corruption) there - if we unwittingly read a decimal value that was
written with a different scale, we could read numbers thinking they're a
different order of magnitude than they actually are.

  cheers,
    rog.

Reply via email to