0
votes

Here I have written one simple replace word UDF in java.
Then I have exported that .java file and created jar file.

Same created jar file added in hive using

Add jar jar file path ;

then I am trying to create temporary function in hive but getting below error

create temporary function  functionname as 'javaprogrampkgname.javaprogramname.';

but for this am getting below error on terminal:

FAILED: Execution Error, return code -101 from org.apache.hadoop.hive.ql.exec.FunctionTask. ReplaceUDFpkg/ReplaceUDF : Unsupported major.minor version 52.0

2
seems like java version mismatch. check compile and runtime java are same - Nirmal Ram
@Nimal Ram Sir, both Java compile and runtime version is same: both are java version "1.7.0_80" javac 1.7.0_80 - Vishnu More
how did you check? how did you create the jar file? - Nirmal Ram

2 Answers

1
votes

Finally got the cause of this error.

Yes, this error due to java version mismatch but as:

I have written, compiled and exported as JAR in eclipse and then this exported JAR trying to use in a different version of java, here due to version mismatch the JVM could not able to call and find this JAR.

I have solved this issue by compiling my java code and creating JAR in "1.7" version which set for my Hadoop home path.

0
votes

It should be the error of your different java version on the place where you created UDF and your hive java version.