Hive-常用函数

1.非空查找函数: COALESCE

语法: COALESCE(T v1, T v2,…)

返回值: T

说明: 返回参数中的第一个非空值;如果所有值都为NULL,那么返回NULL

举例:

hive> select COALESCE(index,-1)  as ind from table_dual;

如果index不为空,则返回index

否则返回-1

2.字符串连接函数concat

DT为环境变量当前日期 year-month-day
concat('${DT}', ' 00:00:00') as time
连接日期和时刻

3.字符串连接函数concat 

猜你喜欢

转载自www.cnblogs.com/BetterThanEver-WWCH/p/9441578.html