[ 
https://issues.apache.org/jira/browse/AVRO-3791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17977630#comment-17977630
 ] 

ASF subversion and git services commented on AVRO-3791:
-------------------------------------------------------

Commit 2808da09ed99c8e2fc03ae5fa5b4570c518c0fb9 in avro's branch 
refs/heads/branch-1.12 from Logan Donoughe
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=2808da09ed ]

AVRO-3791: Include field in readField AvroTypeException (#2420)

In order to bring more clarity and save users time error messages include
the field avro fails to read. It is now immediately apparent which field
in a record has issues that need correcting.

(cherry picked from commit 771d824afa5df0eb4afaa651fb2f7ea7b32ba638)


> [Java] "Found null, expecting <Type>" error should specify field to user
> ------------------------------------------------------------------------
>
>                 Key: AVRO-3791
>                 URL: https://issues.apache.org/jira/browse/AVRO-3791
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Logan Donoughe
>            Priority: Trivial
>              Labels: pull-request-available
>             Fix For: 1.12.1
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> When working with Avro and Flink, I've run into errors like this fairly 
> often: 
> {code:java}
> java.io.IOException: Failed to deserialize consumer record due to
> ...
> Caused by: org.apache.avro.AvroTypeException: Found null, expecting string
>     at 
> org.apache.avro.io.ResolvingDecoder.doAction(ResolvingDecoder.java:308) {code}
> At a glance, this is not particularly useful. I know that some field is 
> getting a null where there is a non-nullable string but in order to find out 
> which one it is I either have to check all possible non-null string fields 
> for null values, look at which columns are changed recently and guess and 
> check, or throw a debugger in and dive down the stack. So far, the last has 
> been the fastest for me.
> Ideally, I would like the error message to tell me which field has the null 
> value so I can fix the problem with high confidence and without the use of a 
> debugger.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to