You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Yanna elina <ya...@gmail.com> on 2019/09/13 09:46:03 UTC
AvroTypeException with "Expected" case : field name is not provided
Hi guys ,
in 1.9 when there is exception like this *"org.apache.avro.AvroTypeException:
Expected start-union. Got END_OBJECT"* .
and* Using genericRecord = reader.read(null, decoder);*
its could be nice to provide the field in error. it could be more easy to
debug the schema.
thx !
Re: AvroTypeException with "Expected" case : field name is not
provided
Posted by fa...@legsem.com.
On 13.09.2019 11:46, Yanna elina wrote:
> Hi guys ,
>
> in 1.9 when there is exception like this "org.apache.avro.AvroTypeException: Expected start-union. Got END_OBJECT" .
> and Using genericRecord = reader.read(null, decoder);
>
> its could be nice to provide the field in error. it could be more easy to debug the schema.
>
> thx !
That would great yes. The field name may not be sufficient though, the
location relative to the schema root would be better I think.
Internally we have defined a simple spec we call avroloc that looks like
recorda.field1.field2.1.recordb.field3 where the numeric step .1 is the
zero-based alternative in case you traverse a union. To signal a
particular item in an array, field2[3] is used in the avroloc.
While we are on the topic of read error reporting, record number and
offset within the record where the offending data is would also help.
Fady