0

While creating an UDF for HIVE, I am getting below error:

org.apache.ambari.view.hive.client.HiveErrorStatusException: 
H110 Unable to submit statement. Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.FunctionTask [ERROR_STATUS]

I am working on hortonworks platform. I tried to create a simple UDF to simulate the issue, is this a config issue?

UDF

package HiveUDF.HIVEUDF;
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;
public final class HIVEUDFUPPER extends UDF
{
 public Text evaluate(final Text s) {
    if (s == null) { return null; }
    return new Text(s.toString().toUpperCase());
}
}

add jar hdfs:///tmp/HIVEUDF.jar;
create temporary function HIVEUDFUPPER as 'HIVEUDFUPPER';
Rajen Raiyarela
  • 5,526
  • 4
  • 21
  • 41
Ashwin Aravind
  • 181
  • 1
  • 7
  • for add jar you require to provide file system jar file path and not hdfs one. Suggestion is to copy the generated jar file to /lib/ directory, and do add jar by providing path to /lib/ – Rajen Raiyarela Feb 08 '16 at 05:23
  • Also you need to provide the complete class path , so 'HiveUDF.HIVEUDF.HIDEUDFUPPER'. – Roberto Congiu Feb 11 '16 at 03:09
  • By the way, the naming of your class/package is against java conventions and will make most Java programmers cringe. Class name should not be all uppercase , and neither should packages. Packages are actually always lowercase and begin with your org's domain. See http://www.oracle.com/technetwork/java/codeconventions-135099.html – Roberto Congiu Feb 11 '16 at 03:13

0 Answers0