博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hive udf
阅读量:2134 次
发布时间:2019-04-30

本文共 1019 字,大约阅读时间需要 3 分钟。

流程

  1. 写java
  2. 打jar包
  3. add jar filePath(可本地,可hdfs)
  4. create temporary function xxx as “your class”
// 1. 继承udf// 2. 实现evaluate方法import org.apache.hadoop.hive.ql.exec.UDF;import org.apache.hadoop.io.Text;public class UDFTest extents UDF {
public Text evaluate(Text input){
return new Text("hello:" + input.toString()); }}
2.6.0
1.1.0
org.apache.hadoop
hadoop-common
${hadoop.version}
org.apache.hive
hive-exec
${hive.version}
junit
junit
4.12

UDF种类

function 用法
UDF
genericUDF
UDAF 多进一出
UDTF 一进多出

Reference

https://blog.csdn.net/Gavin_chun/article/details/78169317

https://blog.csdn.net/qq_34319644/article/details/95668820

你可能感兴趣的文章
【LEETCODE】27-Remove Element
查看>>
【LEETCODE】66-Plus One
查看>>
【LEETCODE】26-Remove Duplicates from Sorted Array
查看>>
【LEETCODE】118-Pascal's Triangle
查看>>
【LEETCODE】119-Pascal's Triangle II
查看>>
【LEETCODE】88-Merge Sorted Array
查看>>
【LEETCODE】19-Remove Nth Node From End of List
查看>>
【LEETCODE】125-Valid Palindrome
查看>>
【LEETCODE】28-Implement strStr()
查看>>
【LEETCODE】6-ZigZag Conversion
查看>>
【LEETCODE】8-String to Integer (atoi)
查看>>
【LEETCODE】14-Longest Common Prefix
查看>>
【LEETCODE】38-Count and Say
查看>>
【LEETCODE】278-First Bad Version
查看>>
【LEETCODE】303-Range Sum Query - Immutable
查看>>
【LEETCODE】21-Merge Two Sorted Lists
查看>>
【LEETCODE】231-Power of Two
查看>>
【LEETCODE】172-Factorial Trailing Zeroes
查看>>
【LEETCODE】112-Path Sum
查看>>
【LEETCODE】9-Palindrome Number
查看>>