How hive3.0.0 customizes functions
This article mainly shows you "hive3.0.0 how to customize the function", the content is easy to understand, clear, hope to help you solve the doubt, the following let the editor lead you to study and learn "hive3.0.0 how to customize the function" this article.
Sample code
Package hello_hive;import org.apache.hadoop.hive.ql.exec.UDFArgumentException;import org.apache.hadoop.hive.ql.metadata.HiveException;import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;import org.apache.hadoop.io.Text Import org.apache.hive.hplsql.Udf;public class HiveTest extends Udf {StringBuilder builder = new StringBuilder (); public String evaluate (String invalue) throws HiveException {int length = invalue.length (); char [] cha = invalue.toCharArray (); for (int I = 0; I