You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Doug Cutting (JIRA)" <ji...@apache.org> on 2014/11/26 20:18:12 UTC

[jira] [Updated] (AVRO-1564) Unknown datum type exception while converting optional bytes using avro-thrift

     [ https://issues.apache.org/jira/browse/AVRO-1564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-1564:
-------------------------------
       Resolution: Fixed
    Fix Version/s: 1.8.0
         Assignee: Michael Pershyn  (was: Doug Cutting)
           Status: Resolved  (was: Patch Available)

I committed this.  Thanks Michael!

> Unknown datum type exception while converting optional bytes using avro-thrift
> ------------------------------------------------------------------------------
>
>                 Key: AVRO-1564
>                 URL: https://issues.apache.org/jira/browse/AVRO-1564
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.7
>            Reporter: Michael Pershyn
>            Assignee: Michael Pershyn
>              Labels: easyfix
>             Fix For: 1.8.0
>
>         Attachments: AVRO-1564-fix.patch, AVRO-1564-test.patch
>
>
> Very similar to AVRO-1500.
> When in thrift schema (e.g. {{Test}}) with optional byte field:
> {code}
> 16: optional byte byteOptionalField
> {code}
> This field is initialized like:
> {code}
> test.setByteOptionalField((byte)4);
> {code}
> Then during conversion of this thrift-object to avro instead of converting it to int 4, the exception is thrown.
> {code}
> org.apache.avro.AvroRuntimeException: Unknown datum type java.lang.Byte: 4                                                                                                                                                                     
>         at org.apache.avro.generic.GenericData.getSchemaName(GenericData.java:637)                                                                                                                                                             
>         at org.apache.avro.thrift.ThriftData.getSchemaName(ThriftData.java:120)                                                                                                                                                                
>         at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:602)                                                                                                                                                              
>         at org.apache.avro.generic.GenericDatumWriter.resolveUnion(GenericDatumWriter.java:151)                                                                                                                                                
>         at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:71)                                                                                                                                                        
>         at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:114) 
> {code}
> ----
> Proposed solution is also similar to AVRO-1500 - to overload {{getSchemaName}} in {{org.apache.avro.thrift.ThriftData}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)