avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <ha...@cloudera.com>
Subject Re: Error when trying to convert a local datafile to plain text with Avro Tools
Date Sat, 19 Jul 2014 16:08:23 GMT
Its useful to have plaintext data in compressed avro files in HDFS for
MR/etc. processing, since the container format allows splitting. The
feature of 'totext'/'from'text' was added originally via AVRO-567.

You may instead be looking for the avro (avrocat) tool? You can obtain
it by installing the Python 'avro' package (easy_install avro, or pip
install avro) and by then running the 'avro' command. It allows
configurable forms of text transformation from regular Avro schema
files.

On Mon, Jul 14, 2014 at 10:52 AM, julianpeeters <julianpeeters@gmail.com> wrote:
> Hi,
>
> I'm exploring the human-readable avro options in the avro-tools jar, namely
> `tojson` and `totext`.
>
> `tojson` works fine, but I try `totext` with:
>
> `$ java -jar avro-tools-1.7.6.jar totext twitter.avro twitter.txt`,
>
> then twitter.txt is empty and I get this error:
>
>     Jul 13, 2014 8:41:19 PM org.apache.hadoop.util.NativeCodeLoader <clinit>
>     WARNING: Unable to load native-hadoop library for your platform... using
> builtin-java classes where applicable
>     Avro file is not generic text schema
>
>
> What am I doing wrong?
>
> Thanks for looking,
> -Julian
>
> PS (Looking into the source, it looks like this error is thrown when the
> schema in the datafile is not equal to the string "\"bytes"\", but I have a
> hard time understanding why the datafile's schema would ever be that.)
>
>
>
>
>
> --
> View this message in context: http://apache-avro.679487.n3.nabble.com/Error-when-trying-to-convert-a-local-datafile-to-plain-text-with-Avro-Tools-tp4030458.html
> Sent from the Avro - Users mailing list archive at Nabble.com.



-- 
Harsh J

Mime
View raw message