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 Threaded View
Avro >> mail # dev >> Default encapsulation of strings fields into unions


Copy link to this message
-
Re: Default encapsulation of strings fields into unions
On Fri, Oct 11, 2013 at 9:24 AM, Youssef Hatem
<[EMAIL PROTECTED]> wrote:
> Since a string can be null, will Avro (Java implementation) encapsulate Bar in a union? (i.e. type of Bar field will be regarded as ["null", "string"]).

If you want to intermix nulls and strings then you need to explicitly
use a union.  If null is passed as a string then a
NullPointerException is thrown.

> Another question, what happens when we want to deserialize a null string?

A serialized string is never null.  It may be an empty string.

Doug
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