No, arbitrary value constraints (aside of "null" checks) cannot be expressed in the schema currently: http://avro.apache.org/docs/current/spec.html#schema_primitive. All values for a given primitive type are taken as a valid one.
On Mon, Mar 30, 2015 at 9:00 PM, Avi Flax <[email protected]> wrote: > Hi all, I’m new to Avro so I apologize if this is a FAQ — I did try to > search the list archives, Google, the spec, etc… > > I just wrote a module that serializes and deserializes a certain data > structure to/from Avro and my module also has a validate method for > validating value constraints that so far I have yet to see how to > express in my Avro schema. For example that certain int fields may not > be 0, or that certain string fields may not be empty. > > Is it possible to express such constraints in an Avro schema? > > Thanks! > Avi -- Harsh J
