Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro, mail # user - Issue writing union in avro?


Copy link to this message
-
Issue writing union in avro?
Jonathan Coveney 2013-04-05, 09:24
I implemented essentially the Java avro example but using the
GenericDatumWriter and GenericDatumReader and hit an issue.

https://gist.github.com/jcoveney/5317904

This is the error:
Exception in thread "main" java.lang.RuntimeException:
org.apache.avro.AvroTypeException: Expected start-union. Got
VALUE_NUMBER_INT
    at com.spotify.hadoop.mapred.Hrm.main(Hrm.java:45)
Caused by: org.apache.avro.AvroTypeException: Expected start-union. Got
VALUE_NUMBER_INT
    at org.apache.avro.io.JsonDecoder.error(JsonDecoder.java:697)
    at org.apache.avro.io.JsonDecoder.readIndex(JsonDecoder.java:441)
    at
org.apache.avro.io.ResolvingDecoder.doAction(ResolvingDecoder.java:229)
    at org.apache.avro.io.parsing.Parser.advance(Parser.java:88)
    at
org.apache.avro.io.ResolvingDecoder.readIndex(ResolvingDecoder.java:206)
    at
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:152)
    at
org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:177)
    at
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:148)
    at
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:139)
    at com.spotify.hadoop.mapred.Hrm.main(Hrm.java:38)

Am I doing something wrong? Is this a bug? I'm digging in now but am
curious if anyone has seen this before?

I get the feeling I am working with Avro in a way that most people do not :)
+
Jonathan Coveney 2013-04-05, 11:15
+
Jonathan Coveney 2013-04-05, 11:59
+
Scott Carey 2013-04-06, 20:36
+
Jonathan Coveney 2013-04-07, 01:42
+
Jonathan Coveney 2013-04-07, 01:49
+
Scott Carey 2013-04-07, 07:16
+
Jonathan Coveney 2013-04-07, 10:47
+
Jeremy Kahn 2013-04-09, 16:16