org.apache.avro.AvroTypeException

Found { "type" : "record", "name" : "Employee", "namespace" : "org.apache.crunch.test", "fields" : [ { "name" : "name", "type" : [ "string", "null" ] }, { "name" : "salary", "type" : "int" }, { "name" : "department", "type" : [ "string", "null" ] } ] }, expecting { "type" : "record", "name" : "Person", "namespace" : "org.apache.crunch.test", "fields" : [ { "name" : "name", "type" : [ "string", "null" ] }, { "name" : "age", "type" : "int" }, { "name" : "siblingnames", "type" : { "type" : "array", "items" : "string" } } ] }

Solutions on the web31

  • via incubator-crunch-user by Micah Whitacre, 1 year ago
    ", "type" : [ "string", "null" ] } ] }, expecting { "type" : "record", "name" : "Person", "namespace" : "org.apache.crunch.test", "fields" : [ { "name" : "name", "type" : [ "string", "null" ] }, { "name" : "age", "type" : "int" }, { "name" : "siblingnames", "type" : { "type" : "array", "items" : "string" } } ] }
  • via incubator-crunch-user by Micah Whitacre, 9 months ago
    ", "type" : [ "string", "null" ] } ] }, expecting { "type" : "record", "name" : "Person", "namespace" : "org.apache.crunch.test", "fields" : [ { "name" : "name", "type" : [ "string", "null" ] }, { "name" : "age", "type" : "int" }, { "name" : "siblingnames", "type" : { "type" : "array", "items" : "string" } } ] }
  • via avro-user by Francois Forster, 1 year ago
    " }, { "name" : "isFeatured", "type" : "boolean" } ] }, expecting [ "null", { "type" : "record", "name" : "Result", "namespace" : "v1", "fields" : [ { "name" : "id", "type" : "string" }, { "name" : "text", "type" : "string" }, { "name" : "isRecommended", "type" : "boolean" } ] } ]
  • Stack trace

    • org.apache.avro.AvroTypeException: Found { "type" : "record", "name" : "Employee", "namespace" : "org.apache.crunch.test", "fields" : [ { "name" : "name", "type" : [ "string", "null" ] }, { "name" : "salary", "type" : "int" }, { "name" : "department", "type" : [ "string", "null" ] } ] }, expecting { "type" : "record", "name" : "Person", "namespace" : "org.apache.crunch.test", "fields" : [ { "name" : "name", "type" : [ "string", "null" ] }, { "name" : "age", "type" : "int" }, { "name" : "siblingnames", "type" : { "type" : "array", "items" : "string" } } ] } at org.apache.avro.io.ResolvingDecoder.doAction(ResolvingDecoder.java:231) at org.apache.avro.io.parsing.Parser.advance(Parser.java:88) at org.apache.avro.io.ResolvingDecoder.readFieldOrder(ResolvingDecoder.java:127) at org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:169) at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:144) at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:135) at org.apache.avro.file.DataFileStream.next(DataFileStream.java:233) at org.apache.crunch.types.avro.AvroRecordReader.nextKeyValue(AvroRecordReader.java:83) at org.apache.crunch.impl.mr.run.CrunchRecordReader.nextKeyValue(CrunchRecordReader.java:72) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:458) at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:76) at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:85) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:139) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:645) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:325) at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:263)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 1 year ago