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 ABEE09560 for ; Mon, 12 Dec 2011 14:49:17 +0000 (UTC) Received: (qmail 27039 invoked by uid 500); 12 Dec 2011 14:49:17 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 27004 invoked by uid 500); 12 Dec 2011 14:49:17 -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 26996 invoked by uid 99); 12 Dec 2011 14:49:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2011 14:49:17 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED X-Spam-Check-By: apache.org Received-SPF: unknown (athena.apache.org: error in processing during lookup of francois.forster@bazaarvoice.com) Received: from [74.125.149.151] (HELO na3sys009aog124.obsmtp.com) (74.125.149.151) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 12 Dec 2011 14:49:09 +0000 Received: from AUSBDC.austin.bazaarvoice.com ([24.155.144.8]) (using TLSv1) by na3sys009aob124.postini.com ([74.125.148.12]) with SMTP ID DSNKTuYUUOc9pMrd5G00bhvlD2MpBhApY5bs@postini.com; Mon, 12 Dec 2011 06:48:49 PST Received: from BVMAIL.austin.bazaarvoice.com ([10.0.0.15]) by AUSBDC.austin.bazaarvoice.com ([10.0.0.23]) with mapi; Mon, 12 Dec 2011 08:48:48 -0600 From: Francois Forster To: "user@avro.apache.org" Date: Mon, 12 Dec 2011 08:48:00 -0600 Subject: RE: Multiple records in a single schema in C++ Thread-Topic: Multiple records in a single schema in C++ Thread-Index: Acy2tvQkzlsKVxYRT02Erxz71nKqlwCJgsZw Message-ID: <7559464B7526184489B168A300ACE1DD25C87DF67B@BVMAIL.austin.bazaarvoice.com> References: <7559464B7526184489B168A300ACE1DD25C87DF318@BVMAIL.austin.bazaarvoice.com> <4EE27937.1040803@apache.org> In-Reply-To: <4EE27937.1040803@apache.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Defining the records in nested format did the trick. Thanks. Francois. -----Original Message----- From: Doug Cutting [mailto:cutting@apache.org]=20 Sent: Friday, December 09, 2011 3:10 PM To: user@avro.apache.org Subject: Re: Multiple records in a single schema in C++ On 12/09/2011 12:57 PM, Francois Forster wrote: > {"name": "opt", "type" : union ["null","cpy"]} That should probably instead be just: {"name": "opt", "type" : ["null","cpy"]} without the keyword 'union'. Could that be causing the error? You could also define the nested record inline, with: { "type": "record", "name": "cpx", "fields" : [ {"name": "re", "type": "double"}, {"name": "im", "type" : "double"}, {"name": "opt", "type" : ["null", {"type": "record", "name": "cpy", "fields" : [{"name": "re", "type": "double"}, {"name": "im", "type" : "double"}] } ] } ] } either should work. Doug