自定义Hive的函数,首先需要继承UDF类,然后定义方法名字为evaluate的方法,该方法不能设置void,如果需要返回为空,可以返回为null.
一个简单的大小写转换案例
特别注意看注释
package com.madman.hive.function;
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
/**
* 注释很重要。。
* 看注释。
* 看注释
* 看英文注释。。。。。。。。。
* */
/**
* A User-defined function (UDF) for the use with Hive.
*
* New UDF classes need to inherit from this UDF class.
*
* Required for all UDF classes: 1. Implement one or more methods named
* "evaluate" which will be called by Hive. The following are some examples:
* public int evaluate(); public int evaluate(in