To move this idea forward, and start exploring what an implementation of unit analysis in native Avro would really look like, I submitted a PR that implements unit analysis for python Avro schema: https://github.com/apache/avro/pull/841
I've also been playing around with a JSON-Schema that defines valid json for unit expressions and unit definitions: https://github.com/erikerlandson/unit-analysis-json-schema/blob/master/unit-analysis-schema.json The current state of the PR supports units on 'record' fields. Supporting units for 'array' also seems desirable. Important infra like unit testing and documentation would also need to be done, but I wanted to put something out there for the Avro community to examine and discuss. Cheers, Erik On Fri, Jun 28, 2019 at 2:58 PM Erik Erlandson <eerla...@redhat.com> wrote: > Hi Avro community, > > Recently I have been experimenting with avro schema that are extended with > a "unit" field. By "unit" I mean expressions like "second", or "megabyte" - > that is "units of measure". > > I delivered a short talk on my experiments at Berlin Buzzwords, which can > be viewed here: > https://www.youtube.com/watch?v=qrQmB2KFKE8 > I also wrote a short blog post that may be faster to ingest: > > http://erikerlandson.github.io/blog/2019/05/23/unit-types-for-avro-schema-integrating-avro-with-coulomb/ > > I received some audience interest in making this concept "first class" for > avro, and so I'm writing to see what the avro dev community thinks of the > idea. One issue is that this kind of unit checking is currently only > available for Scala (and specifically scala 2.13 +). > > The Scala project itself is here: > https://github.com/erikerlandson/coulomb > > Cheers, > Erik > >