From df981251e88c489d579ec0ed549dc64b724b1cea Mon Sep 17 00:00:00 2001 From: "M.Selman" Date: Thu, 25 Jan 2018 17:43:37 +0300 Subject: [PATCH] Update SimpleUDFExample.java It gives error when defined in Hive without public declaration. "Error: FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments 'name': Unable to instantiate UDF implementation class com.matthewrathbone.example.SimpleUDFExample: java.lang.IllegalAccessException: Class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge can not access a member of class com.matthewrathbone.example.SimpleUDFExample with modifiers """ --- .../java/com/matthewrathbone/example/SimpleUDFExample.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/matthewrathbone/example/SimpleUDFExample.java b/src/main/java/com/matthewrathbone/example/SimpleUDFExample.java index b1a5507..368d1cf 100644 --- a/src/main/java/com/matthewrathbone/example/SimpleUDFExample.java +++ b/src/main/java/com/matthewrathbone/example/SimpleUDFExample.java @@ -10,10 +10,10 @@ value="returns 'hello x', where x is whatever you give it (STRING)", extended="SELECT simpleudfexample('world') from foo limit 1;" ) -class SimpleUDFExample extends UDF { +public class SimpleUDFExample extends UDF { public Text evaluate(Text input) { if(input == null) return null; return new Text("Hello " + input.toString()); } -} \ No newline at end of file +}