Hive常用的方法

(1)条件函数
if(1=2,100,200)作用:当条件为TRUE时,返回valueTrue

(2)非空查找函数
coalesce(null,’100′,’50′)作用:返回参数中的第一个非空值

(3)条件判断函数
case id when '001' then '1111' else '2222' end
case when age='20' then 1 else 0 end

(4)类型转换函数

cast(age as string)


猜你喜欢

转载自blog.csdn.net/lhxsir/article/details/79787691