Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro, mail # dev - Default encapsulation of strings fields into unions


Copy link to this message
-
Default encapsulation of strings fields into unions
Youssef Hatem 2013-10-11, 16:24
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
+
Doug Cutting 2013-10-11, 17:53