首页 > 其他 > 详细

hive中内置函数

时间:2019-04-24 15:59:55      阅读:386      评论:0      收藏:0      [点我收藏+]

查看函数的详细使用方法

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

hive中内置函数

原文:https://www.cnblogs.com/dcx-1993/p/10762624.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!