Details
Description
When a field specified in schema is missing and we call avro::encode on the data. It throws an exception, which is as expected. But the issue is with the error message. It comes the other way round.
Schema:
{ "type" : "record", "name" : "userInfo", "fields" : [ { "name" : "id", "type" : "int"}, { "name" : "fullName", "type" : "string" } ] }
The generic datum to be encoded has no "id" provided. There is an empty GenericDatum for that field. Here is the excetion that is thrown:
avro::Exception caught: Invalid operation. Expected: Null got Int
The exception message should have been
avro::Exception caught: Invalid operation. Expected: Int got Null
Please let us know if you need more information on this.