elodina / go-avro

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

GenericDatumWriter encodes Fixed type as Bytes type #78

Open irshusdock opened 8 years ago

irshusdock commented 8 years ago

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) }