hive中内置函数

查看函数的详细使用方法

desc function extended 函数名

例如:

1).desc function extended locate

locate(substr, str[, pos]) - Returns the position of the first occurance of substr in str after position pos

返回第一次出现在字符串str的子串substr的位置,从位置pos开始。 substr不在str中,则返回0。

Example:
> SELECT locate('bar', 'foobarbar', 5) FROM src LIMIT 1;
7

2).desc function extended least

least(v1, v2, ...) - Returns the least value in a list of values

返回列表中的最小值,与GREATEST()函数相反
Example:
> SELECT least(2, 3, 1) FROM src LIMIT 1;
1

 

3)desc function extended regexp

str regexp regexp - Returns true if str matches regexp and false otherwise
Synonyms: rlike

匹配,匹配的上返回true,匹配不上返回false
Example:
> SELECT 'fb' regexp '.*' FROM src LIMIT 1;
true

posted @ 2019-04-24 15:27  小二货儿007  阅读(771)  评论(0编辑  收藏  举报