You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Yang <te...@gmail.com> on 2011/06/01 01:26:11 UTC

"include" ability in schema file?

I have a protocol schema  hello.avpr

{ ....
types: {
   { name : input_msg ,  type: record : fields [
        { name: date , type int },
       { name :msg, type: string}
    ]
  }

}

}


now if I need to serialize the record "input_msg", I'm going to need its
schema,
so I'd need to pass a schema obj to DataFileWriter. but how can I parse the
schema out from schema file?
the schema for "input_msg" is not a standalone file.

I would like a way to write the type of "input_msg" in a standalone file,
and then reference/include that from my hello.avpr.
is this possible?


also btw, for an avro-generate object class, would it be better to make the
getSchema() method static?
that way I can get its schema without creating an actual obj


thanks
Yang

Re: "include" ability in schema file?

Posted by Yang <te...@gmail.com>.
sorry wrong list ... please ignore


On Tue, May 31, 2011 at 4:26 PM, Yang <te...@gmail.com> wrote:

> I have a protocol schema  hello.avpr
>
> { ....
> types: {
>    { name : input_msg ,  type: record : fields [
>         { name: date , type int },
>        { name :msg, type: string}
>     ]
>   }
>
> }
>
> }
>
>
> now if I need to serialize the record "input_msg", I'm going to need its
> schema,
> so I'd need to pass a schema obj to DataFileWriter. but how can I parse the
> schema out from schema file?
> the schema for "input_msg" is not a standalone file.
>
> I would like a way to write the type of "input_msg" in a standalone file,
> and then reference/include that from my hello.avpr.
> is this possible?
>
>
> also btw, for an avro-generate object class, would it be better to make the
> getSchema() method static?
> that way I can get its schema without creating an actual obj
>
>
> thanks
> Yang
>
>