You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by EdwardKing <zh...@neusoft.com> on 2014/02/24 02:53:59 UTC

How to create a avro file?

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"}
  ]
}

the datas are follows:

2012-01-12, Boston, diamond, 3.5
2011-06-13, London, light, 13
2006-06-15, Minneapolis, saucer,0.25


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.





---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------