You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Eddy ALBERT (JIRA)" <ji...@apache.org> on 2017/11/08 12:17:00 UTC

[jira] [Comment Edited] (AVRO-2101) Issue with null default value

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

Eddy ALBERT edited comment on AVRO-2101 at 11/8/17 12:16 PM:
-------------------------------------------------------------

I finally catched the problem ...
I got two different schemas (I only post one in this post), both containing a subrecord called mobile_web_event ...
When generating the avro sources, the subrecord B erased the A and, as the second one has different default values, I thought thetre was a bug in the avro source generation ... ^^!



was (Author: eddya):
I finaly get the problem ...
I got two different schemas with a subrecord sharing the same name ...
When generating the avro sources, the subrecord B erased the A and as the second one has different default values ...


> Issue with null default value
> -----------------------------
>
>                 Key: AVRO-2101
>                 URL: https://issues.apache.org/jira/browse/AVRO-2101
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.2
>         Environment: Java/IntelliJ/Maven
>            Reporter: Eddy ALBERT
>            Priority: Blocker
>
> Hi,
> It seems there is a bug in the Avro library when generating the Avro source files from the Avro schema.
> As you could see in appendice, my schema is based on a main record and several sub-records.  
> I work with "unions" for the type definition to allow setting fields to null when the value is not present.
> *The issue is the following*:
> First of all, this behavior isn't deterministic!
> When the library generates the source file, most of the sub-records are well generated (with null as the default value), but sometime, a single sub-record has its default value set to "null" (String). If I change the default value of the issued sub-record to "foo" and I re-generate the source file, I can see "foo" as the default value. If I rollback that change (back the default value to null) and I re-generate, I finally get null as default value (but not everytime ...).
> I think this issue is the source bug of the one I publish on Stackoverflow (directly see my second post): 
> [https://stackoverflow.com/questions/46775649/handle-nested-avro-record-when-the-one-is-null/46786313#46786313]
> Any suggestions?
> Best regards,
> EddyA.
> Ps: its is always the same sub-record that is issued (mobile_web_event).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)