avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chase Bradford <chase.bradf...@gmail.com>
Subject Re: extra schema attributes?
Date Sat, 26 Feb 2011 19:52:38 GMT
Yep, they are.  We used them to mark fields needing encryption with a special encoder.

Sent from phnoe

On Feb 26, 2011, at 10:42 AM, Ben Weaver <ben@orangesoda.net> wrote:

> Hi,
> 
> 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,
> 
> -Ben

Mime
View raw message