Hive系统函数

Hive内置函数

函数查看
show functions;
desc function functionName;
日期函数

1)当前系统时间函数:current_date()、current_timestamp()、unix_timestamp()

-- 函数1:current_date();		
    当前系统日期		格式:"yyyy-MM-dd"
-- 函数2:current_timestamp();	
    当前系统时间戳:	格式:"yyyy-MM-dd HH:mm:ss.ms"
-- 函数3:unix_timestamp();	
    当前系统时间戳	格式:距离1970年1月1日0点的秒数。

2)日期转时间戳函数:unix_timestamp()

格式:unix_timestamp【死谈破】([date[,pattern]])
案例:
select unix_timestamp('1970-01-01 0:0:0'); -- 传入的日期时间是东八区的时间, 返回值是相对于子午线的时间来说的
select unix_timestamp('1970-01-01 8:0:0'); 
select unix_timestamp('0:0:0 1970-01-01',"HH:mm:ss
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值