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
-
Default encapsulation of strings fields into unions
Hi,

Assume I have the following schema:

{
  "name": "Foo",
  "type":"record",
  "fields":[ {"name": "Bar", "type":"string"} ]
}

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"]).

I am almost certain that it should not because it will lead to inconsistencies with encoding/decoding but I want to make sure.

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

Best regards,
Youssef Hatem
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