Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro >> mail # dev >> Reading nested specific type


+
Bernd Fondermann 2013-05-06, 15:55
+
Doug Cutting 2013-05-06, 17:53
+
Doug Cutting 2013-05-06, 20:30
+
Doug Cutting 2013-05-06, 20:32
+
Bernd Fondermann 2013-05-07, 14:35
+
Doug Cutting 2013-05-07, 16:05
+
Bernd Fondermann 2013-05-07, 19:46
Copy link to this message
-
Re: Reading nested specific type
On Tue, May 7, 2013 at 12:46 PM, Bernd Fondermann
<[EMAIL PROTECTED]> wrote:
> Thanks, the bug is fixed if I don't use a union.

I found the problem with unions & updated the patch for AVRO-1320 to
fix this too.  Please let me know if that solves things for you.

> However, if there are two enums in a union, could the deserialization
> possibly work? How would Avro know which one was serialized?

The position of the schema in the union is written preceding the
value.  So a union of ["null","string"] is written as either a zero
alone or a one followed by a string.  Similarly, enum symbols are
written as their position in their schema.  For example, with the
following two enum schemas:

{"name":"X", "type", "enum", "symbols":["A","B","C"]}
{"name":"Y", "type", "enum", "symbols":["A","C","E"]}

Then the union schema ["X","Y"], an "A" from the first would be
written as zero zero, while the "A" from the second would be one zero.

Does that answer your question?

Doug
+
Bernd Fondermann 2013-05-08, 05:34
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB