title: hive regexp_extract weirdness
body: <p>I am having some problems with regexp_extract:</p>
  
  <p>I am querying on a tab-delimited file, the column I'm checking has strings that look like this:</p>
  
  <pre><code>abc.def.ghi
  </code></pre>
  
  <p>Now, if I do:</p>
  
  <pre><code>select distinct regexp_extract(name, '[^.]+', 0) from dummy;
  </code></pre>
  
  <p>MR job runs, it works, and I get "abc" from index 0.</p>
  
  <p>But now, if I want to get "def" from index 1:</p>
  
  <pre><code>select distinct regexp_extract(name, '[^.]+', 1) from dummy;
  </code></pre>
  
  <p>Hive fails with:</p>
  
  <pre><code>2011-12-13 23:17:08,132 Stage-1 map = 0%,  reduce = 0%
  2011-12-13 23:17:28,265 Stage-1 map = 100%,  reduce = 100%
  Ended Job = job_201112071152_0071 with errors
  FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask
  </code></pre>
  
  <p>Log file says:</p>
  
  <pre><code>java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row
  </code></pre>
  
  <p>Am I doing something fundamentally wrong here?</p>
  
  <p>Thanks,
  Mario</p>