Re: Issue while converting json to avro

2016-11-07 Thread Ryan Blue
Anand,

The problem looks like you're trying to convert regular JSON rather than
Avro JSON. Avro JSON adds an extra layer when storing unions that encodes
the type of the union option, which allows Avro to differentiate between
situations like floats and doubles that look identical in the JSON encoding.

If you want to convert normal JSON to an Avro schema, try using this reader:


https://github.com/rdblue/parquet-cli/blob/master/src/main/java/org/apache/parquet/cli/json/AvroJsonReader.java

rb

On Sun, Nov 6, 2016 at 7:36 PM, Kamesh Kompella  wrote:

> How are you doing the conversion? Can you supply the Avro schema that you
> are using?
>
> Regards
> Kamesh
>
> > On Nov 4, 2016, at 5:10 AM, Anand K  wrote:
> >
> > Hello,
> >
> > I am getting this issue while converting json to avro. PFA my sample
> files, please help me out as to how can I achieve this.
> >
> >
> > Exception in thread "main" org.apache.avro.AvroTypeException: Expected
> start-union. Got VALUE_STRING
> >
> >
> >
> >
> >
> > Thank you,
> > Anand
> > 
>
>


-- 
Ryan Blue
Software Engineer
Netflix


Re: Issue while converting json to avro

2016-11-06 Thread Kamesh Kompella
How are you doing the conversion? Can you supply the Avro schema that you are 
using?

Regards
Kamesh

> On Nov 4, 2016, at 5:10 AM, Anand K  wrote:
> 
> Hello,
> 
> I am getting this issue while converting json to avro. PFA my sample files, 
> please help me out as to how can I achieve this.
> 
> 
> Exception in thread "main" org.apache.avro.AvroTypeException: Expected 
> start-union. Got VALUE_STRING
> 
> 
> 
> 
> 
> Thank you,
> Anand
> 



Issue while converting json to avro

2016-11-04 Thread Anand K
Hello,

I am getting this issue while converting json to avro. PFA my sample files,
please help me out as to how can I achieve this.


Exception in thread "main" org.apache.avro.AvroTypeException: Expected
start-union. Got VALUE_STRING





Thank you,
Anand


test.json
Description: application/json