title: hadoop hive udf fails
body: <p>I've written the following UDF:</p>
  
  <p>ISO8601ToHiveFormat.java:</p>
  
  <pre><code>package hiveudfs;
  
  import org.apache.hadoop.hive.ql.exec.UDF;
  import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  
  public class ISO8601ToHiveFormat  extends UDF {
  
      public String hourFromISO8601(final String d){
          try{
              if( d == null )
                  return null;
              SimpleDateFormat sdf1= new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
              SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
              return sdf2.format(sdf1.parse(d)); 
          } catch (ParseException pe) {
              return null;
          }
      }
  }
  </code></pre>
  
  <p>In the src folder of my project I ran the follwing compile command to compile it:</p>
  
  <pre><code>javac -cp /usr/lib/hive/lib/hive-exec-0.10.0-cdh4.3.0.jar  ISO8601ToHiveFormat.java
  </code></pre>
  
  <p>and supsequntly I packed it into a jar</p>
  
  <pre><code>jar cf ../../HiveUDFs.jar hiveudfs/ISO8601ToHiveFormat.*
  </code></pre>
  
  <p>So, then I started hive and did:</p>
  
  <pre><code>hive&gt; add jar /home/tom/Java/HiveUDFs.jar;
  Added /home/tom/Java/HiveUDFs.jar to class path
  Added resource: /home/tom/Java/HiveUDFs.jar
  hive&gt; create temporary function hourFromISO8601 as 'hiveudfs.ISO8601ToHiveFormat';
  OK
  Time taken: 0.083 seconds
  hive&gt; SELECT hourFromISO8601(logtimestamp) FROM mytable LIMIT 10;
  FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments 'logtimestamp': No matching method for class hiveudfs.ISO8601ToHiveFormat with (string). Possible choices: 
  hive&gt;
  </code></pre>
  
  <p>The output of </p>
  
  <pre><code>hive&gt; describe mytable;
  OK
  ...
  logtimestamp    string
  ...
  </code></pre>
  
  <p>What am I doing wrong here?</p>