Return-Path: X-Original-To: apmail-avro-user-archive@www.apache.org Delivered-To: apmail-avro-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DAC75ED54 for ; Thu, 28 Feb 2013 01:12:57 +0000 (UTC) Received: (qmail 66341 invoked by uid 500); 28 Feb 2013 01:12:57 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 66271 invoked by uid 500); 28 Feb 2013 01:12:57 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 66262 invoked by uid 99); 28 Feb 2013 01:12:57 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Feb 2013 01:12:57 +0000 Received: from localhost (HELO mail-qe0-f49.google.com) (127.0.0.1) (smtp-auth username cutting, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Feb 2013 01:12:57 +0000 Received: by mail-qe0-f49.google.com with SMTP id 1so1003407qec.22 for ; Wed, 27 Feb 2013 17:12:56 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.224.58.201 with SMTP id i9mr11150080qah.81.1362013976366; Wed, 27 Feb 2013 17:12:56 -0800 (PST) Received: by 10.49.121.164 with HTTP; Wed, 27 Feb 2013 17:12:56 -0800 (PST) In-Reply-To: References: Date: Wed, 27 Feb 2013 17:12:56 -0800 Message-ID: Subject: Re: Question about Avro "records" From: Doug Cutting To: user@avro.apache.org Content-Type: text/plain; charset=UTF-8 I don't think that's valid. In general a value should be written for each field in the writer's schema. It's not ideal for json, but those are the rules for binary and it's best if such read/write logic can be unaware of whether json or binary are being produced. I suspect such json would break existing implementations, but I've not checked. Doug On Wed, Feb 27, 2013 at 3:55 PM, Francis Galiegue wrote: > On Thu, Feb 28, 2013 at 12:10 AM, Doug Cutting wrote: >> On Wed, Feb 27, 2013 at 2:51 PM, Francis Galiegue wrote: >>> Hmm, OK, the reader/writer distinction is something I am not accustomed to. >> >> http://avro.apache.org/docs/current/spec.html#Schema+Resolution >> >> Doug > > Hmmm, that does not quite answer my question about production of default values. > > For instance, when emitting data from an avro schema which reads: > > { > "type": "record", > "name": "whatever", > "fields": [ { "name": "a", "type": { "type": "int", "default": 0 } } ] > } > > is emitting {} legal? > > > -- > Francis Galiegue, fgaliegue@gmail.com > JSON Schema in Java: http://json-schema-validator.herokuapp.com