1. Java file name is HelloUDF
2. The Classpath is Java path had been added
3. Are there under the SRC Java files, are also the class files generated within target
Package com. The test;
Import org, apache hadoop. Hive. Ql. Exec. UDF;
Import org, apache hadoop. IO. Text;
Public class HelloUDF extends UDF {
Public Text the evaluate (Text input) {
Return new Text (" Hello "+ input);
}
Public static void main (String [] args) {
HelloUDF udf=new HelloUDF ();
The Text result=udf. Evaluate (new Text (" bag "));
System. The out. Println (result. The toString ());
}
}
CodePudding user response:
Bless me, what a great god can give me the answer tomorrow