Home >> Big Data Hadoop >> Hive How to Write a User Defined Function in Big Data Hadoop

Hive How to Write a User Defined Function in Big Data Hadoop

Create a Java class for the User Defined Function which extends ora.apache.hadoop.hive.sq.exec.UDF and implements more than one evaluate() methods.
Package  Java class into a JAR file (Maven)
Go to Hive CLI, add  JAR, and verify  JARs is in the Hive CLI classpath.
CREATE TEMPORARY FUNCTION in Hive which points to Java class
Use it in Hive SQL.


hive> ADD /home/cloudera/HiveUDFs/target/HiveUDFs-0.0.1-SNAPSHOT.jar;

hive> list jars;

hive> CREATE TEMPORARY FUNCTION STRIP AS 'org.telcom.bigdata.Strip';


Post Your Comment

Next Questions
Hive User Defined Aggregate Functions
Hive Performance Tuning
Hive Rank and Over
Hive Directed Acyclic Graph
Hive with Sqoop
How to save hive query output in csv using python
Hive How To Convert External table to Internal table or vice-versa
Hive What is User Defined Function and User Defined Aggregate Function
What are the different components of a Hive architecture
How can you prevent a large job from running for a long time
What is a Hive Metastore
Explain about the different types of join in Hive
How can you configure remote metastore mode with Hive
How data transfer happens from HDFS to Hive
Hbase Vs Hive
Hive What is the use of Hcatalog
Where is table data stored in Apache Hive by default
Hive Difference between partitioning and bucketing
Explain about the different types of partitioning in Hive
How will you read and write HDFS files in Hive
What are the components of a Hive query processor
Differentiate between describe and describe extended
Will the reducer work or not if you use Limit 1 in any HiveQL query

Copyright ©2022 coderraj.com. All Rights Reserved.