Tutorial by Examples

To create a UDF, we need to extend UDF (org.apache.hadoop.hive.ql.exec.UDF) class and implement evaluate method. Once UDF is complied and JAR is build, we need to add jar to hive context to create a temporary/permanent function. import org.apache.hadoop.hive.ql.exec.UDF; class UDFExample ex...
package MyHiveUDFs; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.hive.ql.exec.UDF; import org.apache.hadoop.io.Text; public class Strip extends UDF { private Text result = new Text(); public Text evaluate(Text str) { if(str == null) { return null; } resul...

Page 1 of 1