Return-Path: X-Original-To: apmail-avro-dev-archive@www.apache.org Delivered-To: apmail-avro-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21A30F2C6 for ; Wed, 8 May 2013 05:35:17 +0000 (UTC) Received: (qmail 42426 invoked by uid 500); 8 May 2013 05:35:16 -0000 Delivered-To: apmail-avro-dev-archive@avro.apache.org Received: (qmail 42010 invoked by uid 500); 8 May 2013 05:35:10 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 41963 invoked by uid 99); 8 May 2013 05:35:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 May 2013 05:35:09 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bernd.fondermann@gmail.com designates 209.85.215.41 as permitted sender) Received: from [209.85.215.41] (HELO mail-la0-f41.google.com) (209.85.215.41) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 May 2013 05:35:02 +0000 Received: by mail-la0-f41.google.com with SMTP id fn20so1374315lab.0 for ; Tue, 07 May 2013 22:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=OI4T8tEuZ/wFSiXJPJjppmiSS/yfkGFm1gIzf/vTqhw=; b=iHJImjpinhZiCiBFMpTvD8EGV90NTl3pgRmA7tph+WxS+xKCvOu8kJMawXgy/TqNR2 lhsGj9rQTBHNA3ax+x5xpDSasCy2VyeDRtg/hVplXOc+/w5Xs24nMckJMVxs+7Ce55sA 4rTHHHPzxiL0I1eVTqPvDZcckmvuF7ooIuqyPnMnRDipXxXyZt4DsWejb/AajnOKB2/N Mwl6w417Qqp21E+v5gLKsD/Vih3ykoGPrZi1RoHMW8CREb8EoEa8J5k3MFCE+AskvOOS H3yWBdh6S3DcQhqusCGhAfiPEsUoj65tNKpC+tthdyQaGdwZpMleMHbjKX9F2nf2RKFP gsHQ== MIME-Version: 1.0 X-Received: by 10.112.160.1 with SMTP id xg1mr2335643lbb.110.1367991281725; Tue, 07 May 2013 22:34:41 -0700 (PDT) Received: by 10.112.155.228 with HTTP; Tue, 7 May 2013 22:34:41 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 May 2013 07:34:41 +0200 Message-ID: Subject: Re: Reading nested specific type From: Bernd Fondermann To: dev@avro.apache.org Content-Type: multipart/alternative; boundary=001a11c333a067359a04dc2e4af8 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c333a067359a04dc2e4af8 Content-Type: text/plain; charset=ISO-8859-1 On Tue, May 7, 2013 at 11:39 PM, Doug Cutting wrote: > On Tue, May 7, 2013 at 12:46 PM, Bernd Fondermann > wrote: > > Thanks, the bug is fixed if I don't use a union. > > I found the problem with unions & updated the patch for AVRO-1320 to > fix this too. Please let me know if that solves things for you. > I'll give it a try. > > > However, if there are two enums in a union, could the deserialization > > possibly work? How would Avro know which one was serialized? > > The position of the schema in the union is written preceding the > value. So a union of ["null","string"] is written as either a zero > alone or a one followed by a string. Similarly, enum symbols are > written as their position in their schema. For example, with the > following two enum schemas: > > {"name":"X", "type", "enum", "symbols":["A","B","C"]} > {"name":"Y", "type", "enum", "symbols":["A","C","E"]} > > Then the union schema ["X","Y"], an "A" from the first would be > written as zero zero, while the "A" from the second would be one zero. > > Does that answer your question? > > I see. - Thank you very much. Bernd --001a11c333a067359a04dc2e4af8--