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

Kevin Oliver commented on AVRO-350:
-----------------------------------

Any thoughts on an approach here for a patch? 

Another option I thought of would be adding a flag to the constructor, boolean 
nullForUnknownFields and using that to determine the behavior. If you want 
stricter upfront checks, then you'd use false, and if you want more of a 
map-like behavior, you'd use true. We could have the existing constructor use 
the appropriate default value. 


> NPE on GenericData.Record.get(String) for a field that doesn't exist
> --------------------------------------------------------------------
>
>                 Key: AVRO-350
>                 URL: https://issues.apache.org/jira/browse/AVRO-350
>             Project: Avro
>          Issue Type: Sub-task
>          Components: java
>    Affects Versions: 1.3.0
>            Reporter: Kevin Oliver
>         Attachments: AVRO-350.patch
>
>
> After the change in AVRO-278 to use arrays, GenericData.Record.get() gives an 
> NPE if you ask for a field that doesn't exist in the schema. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to