elodina / go-avro

Apache Avro for Golang

Home Page:http://elodina.github.io/go-avro/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GenericDatumWriter encodes Fixed type as Bytes type

irshusdock opened this issue · comments

I'm not sure if this is intentional or not, but the GenericDatumWriter currently writes the Fixed type as a Bytes type. That is to say it prepends the bytes with the length of the byte array. This does not follow avro's serialization for Fixed types (which does not include the length of the array). I noticed that in SpecificDatumWriter, the Fixed type is encoded as a Fixed type, hence why I'm not sure if this was intentional or not.

func (writer *GenericDatumWriter) writeFixed(v interface{}, enc Encoder, s Schema) error {
return writer.writeBytes(v, enc)
}