You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Ranjith <ra...@gmail.com> on 2012/10/31 05:52:40 UTC
text files to avro
what is the best way to convert a text file into avro format? does the file need to contain a header? sorry if this is a basic question and has been answered several times.
Thanks,
Ranjith
Re: text files to avro
Posted by Miki Tebeka <mi...@gmail.com>.
Note that input.json is one JSON record per line.
On Wed, Oct 31, 2012 at 9:08 PM, Miki Tebeka <mi...@gmail.com> wrote:
> Actually, I meant something like:
> avro write --schema=/path/to/schema/file input.json > output.avro
>
>
> On Wed, Oct 31, 2012 at 9:04 AM, ranjith raghunath <
> ranjith.raghunath1@gmail.com> wrote:
>
>> Thanks going to give that a shot.
>> On Oct 31, 2012 7:29 AM, "Miki Tebeka" <mi...@gmail.com> wrote:
>>
>>> You can use the "avro" tool that comes with the Python package
>>> (easy_install avro).
>>> It can convert both JSON (one per line) or CSV files to avro.
>>>
>>>
>>> On Tue, Oct 30, 2012 at 9:52 PM, Ranjith <ra...@gmail.com>wrote:
>>>
>>>> what is the best way to convert a text file into avro format? does the
>>>> file need to contain a header? sorry if this is a basic question and has
>>>> been answered several times.
>>>>
>>>> Thanks,
>>>> Ranjith
>>>
>>>
>>>
>
Re: text files to avro
Posted by Miki Tebeka <mi...@gmail.com>.
Actually, I meant something like:
avro write --schema=/path/to/schema/file input.json > output.avro
On Wed, Oct 31, 2012 at 9:04 AM, ranjith raghunath <
ranjith.raghunath1@gmail.com> wrote:
> Thanks going to give that a shot.
> On Oct 31, 2012 7:29 AM, "Miki Tebeka" <mi...@gmail.com> wrote:
>
>> You can use the "avro" tool that comes with the Python package
>> (easy_install avro).
>> It can convert both JSON (one per line) or CSV files to avro.
>>
>>
>> On Tue, Oct 30, 2012 at 9:52 PM, Ranjith <ra...@gmail.com>wrote:
>>
>>> what is the best way to convert a text file into avro format? does the
>>> file need to contain a header? sorry if this is a basic question and has
>>> been answered several times.
>>>
>>> Thanks,
>>> Ranjith
>>
>>
>>
Re: text files to avro
Posted by ranjith raghunath <ra...@gmail.com>.
Thanks going to give that a shot.
On Oct 31, 2012 7:29 AM, "Miki Tebeka" <mi...@gmail.com> wrote:
> You can use the "avro" tool that comes with the Python package
> (easy_install avro).
> It can convert both JSON (one per line) or CSV files to avro.
>
>
> On Tue, Oct 30, 2012 at 9:52 PM, Ranjith <ra...@gmail.com>wrote:
>
>> what is the best way to convert a text file into avro format? does the
>> file need to contain a header? sorry if this is a basic question and has
>> been answered several times.
>>
>> Thanks,
>> Ranjith
>
>
>
Re: text files to avro
Posted by Russell Jurney <ru...@gmail.com>.
An example of doing this is here:
https://github.com/rjurney/Collecting-Data/blob/master/src/python/cat_avro
Russell Jurney http://datasyndrome.com
On Oct 31, 2012, at 5:29 AM, Miki Tebeka <mi...@gmail.com> wrote:
You can use the "avro" tool that comes with the Python package
(easy_install avro).
It can convert both JSON (one per line) or CSV files to avro.
On Tue, Oct 30, 2012 at 9:52 PM, Ranjith <ra...@gmail.com>wrote:
> what is the best way to convert a text file into avro format? does the
> file need to contain a header? sorry if this is a basic question and has
> been answered several times.
>
> Thanks,
> Ranjith
Re: text files to avro
Posted by Miki Tebeka <mi...@gmail.com>.
You can use the "avro" tool that comes with the Python package
(easy_install avro).
It can convert both JSON (one per line) or CSV files to avro.
On Tue, Oct 30, 2012 at 9:52 PM, Ranjith <ra...@gmail.com>wrote:
> what is the best way to convert a text file into avro format? does the
> file need to contain a header? sorry if this is a basic question and has
> been answered several times.
>
> Thanks,
> Ranjith