- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2021 03:21 PM
Hi @Werner Stinckens , Yes i followed the same instructions and was trying to solve this with a java program then later planning to convert python script to a jar file.
Below is the program that i used , Using Eclipse i was able to generate the .jar file successfully by adding "org.apache.hadoop.hive.ql.exec.UDF" this class related jar into the project,
Code :
import org.apache.hadoop.hive.ql.exec.UDF;
public class SimpleUdf extends UDF {
public int evaluate(int value) {
return value + 10;
}
}
Jar file Link :
http://www.java2s.com/Code/Jar/h/Downloadhive041jar.htm
And then tried the below commands
%sql
CREATE FUNCTION simple_udf AS 'SimpleUdf'
USING JAR '/tmp/SimpleUdf.jar';
AND
%sql
CREATE FUNCTION simple_udf AS 'SimpleUdf'
USING JAR '/dbfs/tmp/SimpleUdf.jar';
%sql
select simple_udf(2)
I placed it on the File Store of data bricks cluster and it kept throwing the same error, please make sure the class path is correct.