elodina / go-avro

Apache Avro for Golang
http://elodina.github.io/go-avro/
Apache License 2.0
129 stars 55 forks source link

End of file reached #85

Open mrauter opened 7 years ago

mrauter commented 7 years ago

What could be the problem if I get this error:

End of file reached

At:

decoder := avro.NewBinaryDecoder(message) decodedRecord := avro.NewGenericRecord(avroSchema) err := avroReader.Read(decodedRecord, decoder)

The messages will be decoded correctly by another avro decoder app (Java).

The schema contains only "string" type, but a lot of fields.

{ "type":"record", "name":"schema", "fields":[ { "name":"prop1", "type":"string" }, { "name":"prop2", "type":"string" }, ... ] }

crast commented 7 years ago

Use a DataFileReader : https://godoc.org/gopkg.in/avro.v0#DataFileReader