⑦ split(string str,string par):返回值为array类型。select split('atguigu','g');["at","ui","u"]⑧concat_ws(string spl,string s1,string s2,...):返回值为string类型。select concat_ws('-','a','b','c');a-b-c ⑨ get_json_object(string json,string path):返回值为string类型。s...
get_splitsget_splits(string,int) - Returns an array of length int serialized splits for the referenced tables string. greatestgreatest(v1, v2, ...) - Returns the greatest value in a list of values Example: > SELECT greatest(2, 3, 1) FROM src LIMIT 1; 3 groupinggrouping(a, b) -...
日期转秒函数: second 日期转周函数: weekofyear 日期比较函数: datediff 日期增加函数: date_add 日期减少函数: date_sub 💃 数据函数 •取整函数: round •指定精度取整函数: round •向下取整函数: floor •向上取整函数: ceil •取随机数函数: rand •二进制函数: bin •进制转换函数: conv ...
context_ngrams 第一个参数字符串数组、字符串数组数组 第二个参数将估计主要表达式中ab之后的前'k'个单词 第四个参数是内存 出来结果是NULL 看不懂这个函数 SELECT context_ngrams(sentences(user_id), array('a','b',null), 3).estfrequency FROM data; get_splits 暂时不知道这个函数用法 没有tez引擎 ...
hive字符串分割函数 split(str, regex) - Splits str around occurances that match regex Time taken: 0.769 seconds, Fetched: 1 row(s) 返回值为一个数组 a.基本用法: 例1: split('a,b,c,d',',') 得到的结果: ["a","b","c","d"] ...
11. 幂运算函数: pow 12. 幂运算函数: power 13. 开平方函数: sqrt 14. 二进制函数: bin 15. 十六进制函数: hex 16. 反转十六进制函数: unhex 17. 进制转换函数: conv 18. 绝对值函数: abs 19. 正取余函数: pmod 20. 正弦函数: sin
-- 右补足函数:rpadselectrpad('hi',5,'??');-- 分割字符串函数: split(str, regex)selectsplit('apache hive','\\s+');-- 集合查找函数: find_in_set(str,str_array)selectfind_in_set('a','abc,b,ab,c,def');-- 分割字符串函数: split(str, regex)selectsplit('apache hive','\\s+'...
tableAlias:表示UDTF函数转换的虚拟表的名称。columnAlias:表示虚拟表的虚拟字段名称,如果分裂之后有一个列,则写一个即可;如果分裂之后有多个列,按照列的顺序在括号中声明所有虚拟列名,以逗号隔开。selectname,commentfrommyhive.json_testLATERAL VIEW explode(split(get_json_object(str,"$.name"),','))name...
2.日期增加/减少函数: date_add/date_sub 语法: date_add(string startdate, int days),date_sub (string startdate, int days) 返回值: string 说明: 返回开始日期startdate增加days天后的日期,返回开始日期startdate减少days天后的日期。hive> select date_add('2012-12-08',10) 2012-12-18 hive> ...
1、Hive系统内置函数 1.1、数值计算函数 1、取整函数: round 语法: round(double a)返回值: BIGINT说明: 返回double类型的整数值部分 (遵循四舍五入) hive> select round(3.1415926) from tableName; 3 hive> select round(3.5) from tableName;