title: Hive UDF does not return expected result
body: <p>I have written an UDF that can be called by Hive (Query Language) that takes 2 parameters and has the following logic:</p>
  
  <p>returns null if both arguments are null
  returns the non null value if one argument is null
  returns the greater of two values if both passed in arguments are not null</p>
  
  <p>I have written the code, compiled the class, and successfully registered the JAR with Hive. I verified I can see the function in HIVE after creating the temporary function. The problem I am having is that when I call it from a select, it just returns '_c0' rather than a the expected value:</p>
  
  <p>Here is the java class definition. </p>
  
  <pre><code>package com.ispace.hive.udf;
  
  import org.apache.hadoop.hive.ql.exec.UDF;
  import org.apache.hadoop.hive.ql.exec.Description;
  import java.util.*;
  /*
  *
  * Compilation on Local box is very environment specific but for the iMac in 2013, this command will compile the class:
  * javac -target 1.6 -cp $(ls /usr/local/Cellar/hive/0.12.0/libexec/lib/hive-exec*.jar):/usr/local/Cellar/hadoop/1.2.1/libexec/lib/hadoop-core.jar com/ispace/hive/udf/GreaterOf.java
  * 
  * The above step creates a single .class file that needs to be bundled into a JAR (java archive file)
  * To bundle a file or multiple files into a jar, you can run this:
  *       jar cvf udfcomparer.jar ./com/ispace/hive/udf/GreaterOf.class ./com/ispace/hive/udf/LesserOf.class
  *
  * To call a UDF, you must add the JAR to your hive session and then create a 'temporary'function as follows:
  *
  * hive (default)&gt; ADD JAR /Users/calvinimac/Documents/Safezone/Projects/prospect-visual/etl/scripts/ec2-emr/jars/udfcomparer.jar;            
  * hive (default)&gt; create temporary function inlinemax as 'com.ispace.hive.udf.GreaterOf';
  */
  
  @Description(name = "GreaterOf",
               value = "_FUNC_(Integer s, Integer t) - returns the greater value of the two.\n"+
                          "If both values are null, it will return NULL.\n"+
                          "If one value is non null, it will return that value if the other is NULL.",
               extended = "Example:\n"
                      + " &gt; SELECT _FUNC_(column1, column2) FROM src;")
  
  public final class GreaterOf extends UDF {
    public Integer evaluate(final Integer s, final Integer t) {
      Integer result = null;
  
      if (s == null &amp;&amp; t == null) { 
          result = null; 
      } else if (s == null) {
          result = t;
      } else if (t == null) {
          result = s;
      } else if (s &gt;= t) {
          result = s;
      } else {
          result = null;   
      }
  
      return result;
    }
  }
  </code></pre>
  
  <p>In Hive, I create a placeholder table (unused) 
  create table unused(id bigint)
  Then I run this select:
  select inlinemax(2,4) from unused</p>
  
  <p>I was expecting to get a result of 4 but instead I get 'c0'. </p>
  
  <p>Is my UDF wrong and will it handle Hive null values as arguments and correctly map them into my Integer method parameters?</p>