HQL
Darin2017
Python兴趣
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HIVE时间差及回滚
LEAD(createtime, 1) over(partition by masterid, talker order by unixtime desc) lastendtime, cast((unixtime-(lead(unixtime, 1) over(partition by masterid, talker order by unixtime ...原创 2021-11-05 17:30:04 · 1807 阅读 · 0 评论 -
hive星期函数
01、取当前周的周一:select date_add(next_day(current_date, 'MO'), -7)当前日期(2021-07-27)返回结果:02、整理日期格式:取当前日期年月:select date_format(current_date, 'yyyy-MM');返回结果:03、取当月最后一天:select last_day(current_date)返回结果:04、 年度第几周函数(周一至...原创 2021-07-27 14:30:46 · 4459 阅读 · 0 评论 -
hivesql日期转换
hivesql:日期转换:2020-09-08 转换为20200908select from_unixtime(unix_timestamp(date_sub(current_date,30),‘yyyy-MM-dd’),‘yyyyMMdd’)原创 2021-01-20 17:56:57 · 1401 阅读 · 0 评论 -
窗口函数编号及行转列
窗口函数中dense_rank() 与rank()函数的区别:1、dense_rank()该函数用于计算连续排名。col2相同的行数据获得的排名相同。2、 rank() 该函数用于计算排名。col2相同的行数据获得排名顺序下降。dense_rank 产生的排名是连续的,比如:1,1,2,2,3,4rank产生的排名是递减的,比如:1,1,3,3,5,6...原创 2020-11-27 16:41:09 · 341 阅读 · 0 评论 -
Hive sql之interval 1 month
当前日期(2020-11-02)步骤一:selectcurrent_date - interval 1 day,current_date - interval 2 day,current_date - interval 3 day,current_date - interval 4 day结果为:2020-11-01 00:00:002020-10-31 00:00:002020-10-30 00:00:002020-10-29 00:00:00发现没问题;步骤二:select原创 2020-11-02 18:48:22 · 5379 阅读 · 0 评论 -
hive中regexp_replace,regexp_extract,replace和translate的区别
1.Hive内嵌函数说明官方地址:hive函数大全官方地址 Hive字符处理函数系列1:hive内嵌字符串函数1String FunctionsReturn TypeName(Signature)Descriptionregexp_extract(string subject, string pattern, int index)Returns the string extracted using the pattern. For example, regexp_extract(‘fo原创 2020-08-20 16:11:55 · 3221 阅读 · 0 评论 -
hive 时间戳函数之unix_timestamp,from_unixtime
一. 日期>>>>时间戳1.unix_timestamp() 获取当前时间戳例如:select unix_timestamp() --15658583892.unix_timestamp(string timestame) 输入的时间戳格式必须为'yyyy-MM-dd HH:mm:ss',如不符合则返回null例如:select unix_timestamp('2019-08-15 16:40:00') --1565858400se.原创 2020-08-12 13:48:01 · 1132 阅读 · 0 评论
分享