avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lewis John Mcgibbney <lewis.mcgibb...@gmail.com>
Subject Re: How to create a avro file?
Date Wed, 26 Feb 2014 12:58:06 GMT
Hi EdwardKing,


On Mon, Feb 24, 2014 at 1:53 AM, EdwardKing <zhangsc@neusoft.com> wrote:

> I want to create a avro file named sightings.avro,it's structure is
> follows:
> { "type": "record",
>   "name": "UFO_Sighting_Record",
>   "fields" : [
>    {"name": "sighting_date", "type": "string"},
>    {"name": "city", "type": "string"},
>    {"name": "shape", "type": ["null", "string"]},
>    {"name": "duration", "type": "float"}
>   ]
> }
>

Schema definition looks fine apart from the name. You will wish to edit
this to sightings


> I want to use java to create above sightings.avro file,but I am a newbie
> to avro 1.7.6,I don't know how to realized it. Anyone could give me an demo
> to do it? Thanks in advance.
>


Take a look at the current documentation for the Java API. It is very
comprehensive.
http://avro.apache.org/docs/current/gettingstartedjava.html

Also you should want to look through some mailing list questions. Reading
CSV data and serializing it outside of a MR environment is certainly in
previously asked questions.
hth
Lewis

Mime
View raw message