title: Apache Pig: Replace null with string
body: <p>I'm having a lot of null entries in my data. Due to later processing it would be very helpful if I could set a default value for null to be the string "other". I couldn't find a way to do this (version 0.8.1-cdh3u4)</p>
  
  <p>Also, I have some variables in my GENERATE statements that can potentially return null, and I would need something similar to the SQL DECODE function to get the "other" string instead of null.</p>
  
  <p>Example:</p>
  
  <pre><code>tmp = FOREACH dump GENERATE site, REGEX_EXTRACT(name, '^(?:([^.]+)\\.?){1}', 1) AS project, ((ami MATCHES '.*datatype.*') ? REGEX_EXTRACT(name, '^(?:([^.]+)\\.?){5}', 1) : 'other') AS datatype, ami, duid, nbfiles, length, rnbfiles, rlength, name; 
  </code></pre>
  
  <p>Here: 'site' and 'datatype' could return an empty string (which is valid) and is interpreted as null, but should be "other" instead.</p>
  
  <p>Thanks a lot.</p>