avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1512) Error serializing TUnion with avro-thrift
Date Wed, 28 May 2014 22:38:03 GMT

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

Hudson commented on AVRO-1512:
------------------------------

FAILURE: Integrated in AvroJava #453 (See [https://builds.apache.org/job/AvroJava/453/])
AVRO-1512. Java: Support Thrift unions. (cutting: rev 1598159)
* /avro/trunk/CHANGES.txt
* /avro/trunk/lang/java/thrift/src/main/java/org/apache/avro/thrift/ThriftData.java
* /avro/trunk/lang/java/thrift/src/test/java/org/apache/avro/thrift/TestThrift.java
* /avro/trunk/lang/java/thrift/src/test/java/org/apache/avro/thrift/test/FooOrBar.java
* /avro/trunk/lang/java/thrift/src/test/java/org/apache/avro/thrift/test/Test.java
* /avro/trunk/lang/java/thrift/src/test/thrift/test.thrift


> Error serializing TUnion with avro-thrift
> -----------------------------------------
>
>                 Key: AVRO-1512
>                 URL: https://issues.apache.org/jira/browse/AVRO-1512
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.6
>            Reporter: Will Gorman
>            Assignee: Doug Cutting
>             Fix For: 1.7.7
>
>         Attachments: AVRO-1512.patch, test.thrift
>
>
> Attempting to serialize a Thrift union type (TUnion) with avro-thrift produces an error
like the following:
> {noformat}
> org.apache.avro.AvroRuntimeException: Unknown datum type org.apache.avro.thrift.test.FooOrBar:
<FooOrBar foo:foo>
> 	at org.apache.avro.generic.GenericData.getSchemaName(GenericData.java:639)
> 	at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:604)
> 	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)
> 	at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:104)
> 	at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:66)
> 	at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:58)
> 	at org.apache.avro.thrift.TestThrift.check(TestThrift.java:83)
> 	at org.apache.avro.thrift.TestThrift.testStruct(TestThrift.java:60)
> {noformat}
> Upon investigation it appears that ThriftData#isRecord intentionally does not accept
TUnion types as Avro records and so GenericData is unable to determine an Avro type for the
datum.  However, ThriftData#getSchema does generate an Avro record schema for Thrift union
types.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message