Re: How to fix Expected start-union. Got VALUE_NUMBER_INT when converting JSON to Avro on the command line?

2014-12-15 Thread Emre Sevinc
Thank you very much for the solution and its explanation. -- Emre Sevinç On Mon, Dec 15, 2014 at 8:12 PM, Doug Cutting wrote: > > Avro's JSON encoding requires that non-null union values be tagged > with their intended type. This is because unions like > ["bytes","string"] and ["int","long"] ar

Re: How to fix Expected start-union. Got VALUE_NUMBER_INT when converting JSON to Avro on the command line?

2014-12-15 Thread Doug Cutting
Avro's JSON encoding requires that non-null union values be tagged with their intended type. This is because unions like ["bytes","string"] and ["int","long"] are ambiguous in JSON, the first are both encoded as JSON strings, while the second are both encoded as JSON numbers. http://avro.apache.o

How to fix Expected start-union. Got VALUE_NUMBER_INT when converting JSON to Avro on the command line?

2014-12-15 Thread Emre Sevinc
Hello, I'm trying to validate a JSON file using an Avro schema and write the corresponding Avro file. First, I've defined the following Avro schema named user.avsc: {"namespace": "example.avro", "type": "record", "name": "user", "fields": [ {"name": "name", "type": "string"}, {"name"