[prev in list] [next in list] [prev in thread] [next in thread] 

List:       avro-user
Subject:    Re: avrogencpp generates vector of $Undefined$ type
From:       Harsh J <harsh () cloudera ! com>
Date:       2012-08-28 4:04:39
Message-ID: CAOcnVr3ZDh_ip-pYGqg9MS=dGV2XXt5ng43u5v+c+c8SJUbp7Q () mail ! gmail ! com
[Download RAW message or body]

Hey Jan,

Perhaps filing a JIRA with your reproduction steps and a sample,
runnable test case will help speed this up. Seems like a genuine bug,
so you should go ahead!

On Tue, Aug 28, 2012 at 5:30 AM, Jan van der Lugt <janlugt@gmail.com> wrote:
> It seems the $Undefined$ is coming from an AVRO_UNION type, which is also
> not checked in the cppTypeOf method. I could try to come up with some
> solution, but if someone with knowledge of this code could tell me what the
> issue is and why AVRO_UNION is not being handled, that would be very
> helpful.
>
> - Jan
>
>
> On Sun, Aug 26, 2012 at 9:56 PM, Jan van der Lugt <janlugt@gmail.com> wrote:
>>
>> 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++ 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 <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, 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 <janlugt@gmail.com>
>>> > 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
>>
>>
>



-- 
Harsh J

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic