Reference Tutorial Link from Microsoft
The process of using udf function:
-
New a maven project, and add dependencies:
<dependencies> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-client</artifactId> <version>2.7.3</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.hive</groupId> <artifactId>hive-exec</artifactId> <version>1.2.1</version> <scope>provided</scope> </dependency> </dependencies>
-
Create a class, and write your own function like "lowercase" function
-
Using maven to build a jar package
-
Copy the
.jar
file toHDFS
-
Load the jarfile as a function, then you can use the function in
HiveQL
TODO:
- Add more use cases [x]