Hive内置函数之时间函数

Hive内置函数之时间函数,第1张

零、生产常用组合方式

(01)离线数仓获取昨天的日期作为分区,格式yyyyMMdd

regexp_replace(date_sub(from_unixtime(unix_timestamp(),'yyyy-MM-dd'),1) ,'-','')

或者

date_format(date_sub(from_unixtime(unix_timestamp(),'yyyy-MM-dd'),1),'yyyyMMdd')

一、源码部分

Hive的函数类为:orgapachehadoophiveqlexecFunctionRegistry

二、常用时间函数

对于函数,除了知道怎么用,还需要知道返回值是什么类型,这里给出官方文档,文档中给出了函数的返回值类型

官方文档见: >

select orderid,fenjian,timee

from

(

select orderid,fenjian,timee,row_number(orderid,fenjian) rn

from (

select orderid,fenjian,timee from tableName

distribute by orderid,fenjian sort by orderid,fenjian,timee asc

) t1

) t2

where t2rn=1

以上就是关于Hive内置函数之时间函数全部的内容,包括:Hive内置函数之时间函数、hive 里的时间是什么数据类型、hivesql取最小时间所在字段等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/9637726.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-30
下一篇2023-04-30

发表评论

登录后才能评论

评论列表(0条)

    保存