Avro, mail # user - Re: what's the efficiency difference between type: "string" and ["string", "null"] - 2014-03-14, 17:49
 Search Hadoop and all its subprojects:

Switch to Threaded View
Copy link to this message
-
Re: what's the efficiency difference between type: "string" and ["string", "null"]
One small note: the best practice is to place "null" first when it's
in a union.  This is because the type of a default value for a union
field is the type of the first element of the union, and null is the
most commonly used default value for unions with null.  So the idiom
for a field that defaults to null is:

{"name",<<field name>>,"type":["null",<<field type>>],"default":null}

I've updated the specification to clarify this point.

https://issues.apache.org/jira/browse/AVRO-1482

Doug

On Fri, Mar 14, 2014 at 1:56 AM, Bertrand Dechoux <[EMAIL PROTECTED]> wrote:

 
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