Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How hive3.0.0 customizes functions

Shulou Source: shulou.com Published: 2022-06-01 14:25:04 09月26日 Update

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

Tags: Functions content articles help learning code information easy to understand more organization knowledge examples types editing industry information information channels logic channels research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker OPPO Reno Apple Microsoft Huawei