avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Weaver <...@orangesoda.net>
Subject extra schema attributes?
Date Sat, 26 Feb 2011 18:42:51 GMT

I'm making a data mapper that stores Avro documents in a database. I want to
track extra configuration details with each schema. Are application-specific
attributes allowed in Avro schema?

For example:

  type: "record",
  name: "User",
  fields: [
    { type: "string", name: "username" },
    { type: "string", name: "email" },
    { type: "string", name: "password", hidden: true }
  unique: ["username", "email"]

This hypothetical record might be used to keep track of user accounts. It
uses a nonstandard `hidden` attribute of the "password" field to indicate
the password shouldn't be exposed in certain circumstances. The `unique`
attribute of the record indicates the "username" and "email" fields are
constrained to be unique across all User records and implies the database
should index these fields.

Is it OK to add these kinds of attributes? Will Avro implementations throw
errors or ignore them if present?

Many thanks,


View raw message