当前位置:首页 > 刘月
刘月

刘月 网站编辑

暂无介绍

8 篇文章 0 次评论

hive : row_number over(partition by,order by)用法

刘月2年前 (2022-05-27)2043
hive : row_number over(partition by,order by)用法
语法格式:row_number() over(partition by 分组列 order by 排序列 desc) 注意: 在使用 row_number() over()函数的时候,over()里面的分组以及排序的执行晚于 where、g...

hive行转列,炸裂,数组提取lateral view, json_tuple

刘月2年前 (2022-05-26)1654
hive行转列,炸裂,数组提取lateral view, json_tuple
selectjsondata, aaa,bbb,ccc, ddd,eee,fff,gggfromtable11lateral view json_tuple(jsondata,’aaa’,’bbb’,’ccc’,’ddd’,’eee’,’f...

hive nvl,从concat, concat_ws, collect_set 行转列

刘月2年前 (2022-05-25)10074
nvl(value,default_value)如果value为null,则返回default_value的值,否则返回value 用法: select id,if(name is null,0,name) from test; 等同于 s...

regexp, regexp_extract

刘月2年前 (2022-05-25)10670
1、 regexp 案例1: SELECT regexp('aa这ZZ你好11二位努力五零&&&&&','^[A-Za-z0-9\u4e00-\u9fa5]'); 结果: true 解释: 匹配 非英...

HIve SQL 优化

刘月3年前 (2021-04-19)898
一. Hive SQL执行顺序1.from 2.join on 或 lateral view explode(需炸裂的列) tbl as 炸裂后的列名 3.where 4.group by (开始使用select中的别名,...

判断日期是星期几

刘月3年前 (2021-02-02)963
from_unixtime(cast(b.publicdate as bigint),’yyyy’) = year(date_sub(to_date(concat(year(current_date()),’-‘,lpad(ceil(mo...

时间差

刘月3年前 (2021-01-28)991
–日期差–转换成时间戳相减,得到相差的秒数,在转换成分钟、小时(unix_timestamp(updatedate) - unix_timestamp(createdate))/3600 as time_diff – date——form...

常用日期函数

刘月3年前 (2021-01-26)923
– 常用 当天select CURRENT_DATE() 取昨天select date_sub(from_unixtime(unix_timestamp()),1)select date_sub(current_date(),1) 例...