avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <ha...@cloudera.com>
Subject Re: Value constraints in schemas?
Date Tue, 31 Mar 2015 07:13:41 GMT
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 <avi@timehop.com> 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

View raw message