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 26FADDCAD for ; Mon, 27 Aug 2012 04:57:03 +0000 (UTC) Received: (qmail 19528 invoked by uid 500); 27 Aug 2012 04:57:02 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 19085 invoked by uid 500); 27 Aug 2012 04:56:59 -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 19053 invoked by uid 99); 27 Aug 2012 04:56:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2012 04:56:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of janlugt@gmail.com designates 209.85.214.171 as permitted sender) Received: from [209.85.214.171] (HELO mail-ob0-f171.google.com) (209.85.214.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2012 04:56:53 +0000 Received: by obqv19 with SMTP id v19so7606856obq.30 for ; Sun, 26 Aug 2012 21:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=mXZccHputO5qeyEq/hYIcJggVggqIP+rX4Z/upjl0Sg=; b=uEGsTK+bNumWhg93yt/L9C2V1bJdJ07vbzjNeLZnk9HR2z38OEXDM0Su6+jcstncEJ jwftx1fdoSvDv7XxNrXD2Mz+XJtp68lD2GnKP8GtClL99S6hz4hORfRKSQhOwtPMuMb8 lEFTu37DWMWze2Yx4AXcBsvAf1frB34nMjRBP2LLiAWLQrc79jMZi7XJ84TqthXIcTlo eJUoKTmTS/qqx5ZhsTo4vxAMjGP/R89B/qj9BAyKdv9x18/2Uh/xQRNSThIoqjuqt9QX I0HUwXazloLk1a500gFcbcYtJCkLfra1JyQ/YZ0EOOssuzWyBatPehxM0buayq64p6Jw OjkQ== MIME-Version: 1.0 Received: by 10.60.25.104 with SMTP id b8mr9011295oeg.140.1346043392983; Sun, 26 Aug 2012 21:56:32 -0700 (PDT) Received: by 10.76.21.211 with HTTP; Sun, 26 Aug 2012 21:56:32 -0700 (PDT) In-Reply-To: References: Date: Sun, 26 Aug 2012 21:56:32 -0700 Message-ID: Subject: Re: avrogencpp generates vector of $Undefined$ type From: Jan van der Lugt To: user@avro.apache.org Content-Type: multipart/alternative; boundary=e89a8fb1fa0a4a817904c8382681 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8fb1fa0a4a817904c8382681 Content-Type: text/plain; charset=ISO-8859-1 Good find! I'll take a look at this tomorrow, see if I can come up with a fix. On Sun, Aug 26, 2012 at 5:26 AM, Harsh J wrote: > I'm not an expert on the Avro C++ implementation, but I wonder if this > is cause of the nulls not being checked for in > http://svn.apache.org/repos/asf/avro/trunk/lang/c++/impl/avrogencpp.cc's > CodeGen::cppTypeOf method. > > On Sun, Aug 26, 2012 at 1:54 PM, Jan van der Lugt > wrote: > > Hi all, > > > > Sorry to be impatient, but could someone please comment on this issue? I > > know that the C++ version isn't as popular as the Java version, but the > > whole idea is to make information exchange between applications in > different > > languages easier, right? > > > > - Jan > > > > > > On Sat, Aug 18, 2012 at 12:10 AM, Jan van der Lugt > > wrote: > >> > >> Hi all, > >> > >> After deciding on Apache Avro for one of the main formats for storing > our > >> graph data, I tried to integrate it with our graph processing system > built > >> in C++. If I generate a header file from the attached Avro schema using > >> avrogencpp, I get a vector of type $Undefined$ somewhere in the > generated > >> code (see the snippet below). Is there an error in my schema or is this > a > >> bug in avrogencpp? Thanks in advance for your help! > >> > >> - Jan > >> > >>> static void decode(Decoder& d, gm::gm_avro_graph_avpr_Union__5__& v) { > >>> size_t n = d.decodeUnionIndex(); > >>> if (n >= 2) { throw avro::Exception("Union index too big"); } > >>> switch (n) { > >>> case 0: > >>> d.decodeNull(); > >>> v.set_null(); > >>> break; > >>> case 1: > >>> { > >>> std::vector<$Undefined$ > vv; > >>> avro::decode(d, vv); > >>> v.set_array(vv); > >>> } > >>> break; > >>> } > >>> } > > > > > > > > -- > Harsh J > --e89a8fb1fa0a4a817904c8382681 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Good find! I'll take a look at this tomorrow, see if I can come up with= a fix.

On Sun, Aug 26, 2012 at 5:26 AM, = Harsh J <harsh@cloudera.com> wrote:
I'm not an expert on the Avro C++ implem= entation, but I wonder if this
is cause of the nulls not being checked for in
http://svn.apache.org/repos/asf/avro/trunk/= lang/c++/impl/avrogencpp.cc's
CodeGen::cppTypeOf method.

On Sun, Aug 26, 2012 at 1:54 PM, Jan van der Lugt <janlugt@gmail.com> wrote:
> Hi all,
>
> Sorry to be impatient, but could someone please comment on this issue?= I
> know that the C++ version isn't as popular as the Java version, bu= t the
> whole idea is to make information exchange between applications in dif= ferent
> languages easier, right?
>
> - Jan
>
>
> On Sat, Aug 18, 2012 at 12:10 AM, Jan van der Lugt <janlugt@gmail.com>
> wrote:
>>
>> Hi all,
>>
>> After deciding on Apache Avro for one of the main formats for stor= ing our
>> graph data, I tried to integrate it with our graph processing syst= em built
>> in C++. If I generate a header file from the attached Avro schema = using
>> avrogencpp, I get a vector of type $Undefined$ somewhere in the ge= nerated
>> code (see the snippet below). Is there an error in my schema or is= this a
>> bug in avrogencpp? Thanks in advance for your help!
>>
>> - Jan
>>
>>> static void decode(Decoder& d, gm::gm_avro_graph_avpr_Unio= n__5__& v) {
>>> size_t n =3D d.decodeUnionIndex();
>>> if (n >=3D 2) { throw avro::Exception("Union index too= big"); }
>>> switch (n) {
>>> case 0:
>>> d.decodeNull();
>>> v.set_null();
>>> break;
>>> case 1:
>>> {
>>> std::vector<$Undefined$ > vv;
>>> avro::decode(d, vv);
>>> v.set_array(vv);
>>> }
>>> break;
>>> }
>>> }
>
>



--
Harsh J

--e89a8fb1fa0a4a817904c8382681--