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

ASF GitHub Bot commented on AVRO-1954:
--------------------------------------

nandorKollar commented on issue #290: AVRO-1954 - Schema.Field.defaultVal() 
generates: Unknown datum type org.apache.avro.JsonProperties$Null
URL: https://github.com/apache/avro/pull/290#issuecomment-371214137
 
 
   @derekstraka I cherry-picket and 
[committed](https://github.com/apache/avro/commit/10792f777f5a31f8c1e5d9a6f6c6d4ba2727ab58)
 the fix to branch-1.8 and will be release with the next release from 1.8 
branch. If it looks good to you, you can close this PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Schema.Field.defaultVal() generates: Unknown datum type 
> org.apache.avro.JsonProperties$Null
> -------------------------------------------------------------------------------------------
>
>                 Key: AVRO-1954
>                 URL: https://issues.apache.org/jira/browse/AVRO-1954
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.1, 1.9.0
>            Reporter: rui miranda
>            Assignee: Nandor Kollar
>            Priority: Minor
>             Fix For: 1.9.0
>
>         Attachments: unitTestDefaultNull.patch
>
>
> I was creating GenericRecords and populating some fields -- which i could not 
> find the content on some json files -- with the Schema.Field.defaultVal(). 
> It seems if the schema has explicitly set the default value to be null, the 
> records generated this way can't be written. In this case, if default value 
> is null in the schema, an instance of 
> org.apache.avro.JsonProperties.NULL_VALUE is returned by 
> Schema.Field.defaultVal().
> I created an unit test which replicates the bug. I was thinking modify the 
> class org.apache.avro.generic.GenericData to evaluate 
> org.apache.avro.JsonProperties.NULL_VALUE as null. Is this the way to go? or 
> org.apache.avro.JsonProperties.NULL_VALUE is intend for other purposes?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to