
hive
轻风细雨
加油
展开
-
Hive 多数组合并 CONCAT_WS
Hive 多数组合并 使用CONCAT_WS和split 完成多个数组合成一个数组原创 2022-08-30 11:50:39 · 6700 阅读 · 0 评论 -
关于面试--【hive内表和外边的区别】
面试总结原创 2022-06-29 11:21:17 · 223 阅读 · 0 评论 -
hive max和min计算跨天最早最晚登录时间
with loin_format as( selectuser_id,dt,case when cast(hour(login_time) as int) <=4 then concat( (cast(hour(login_time) as int) + 24),'@',login_time) else concat(hour(login_time) ,'@',login_time) end as login_time_formatfrom ods.user_login ..原创 2021-12-06 15:15:20 · 1585 阅读 · 0 评论 -
hive 根据记录表,获取开始时间和结束时间,时间差
表结构id int 主键 projectid int 项目id createdate string 创建时间id projectid createdate 8 179 2019-01-03 1...原创 2021-11-19 09:24:55 · 1861 阅读 · 0 评论 -
hivesql 大全记得收藏
1. 等值比较: =语法:A=B操作类型:所有基本类型描述: 如果表达式A与表达式B相等,则为TRUE;否则为FALSE举例:hive>select 1 from test_table where 1=1;2. 不等值比较: <>语法: A <> B操作类型: 所有基本类型描述: 如果表达式A为NULL,或者表达式B为NULL,返回NULL;如果表达式A与表达式B不相等,则为TRUE;否则为FALSE举例:hive> select1 from tes原创 2020-12-10 16:27:32 · 1166 阅读 · 0 评论 -
hive 计算两个时间相差的分钟
select unix_timestamp(checktime,'yyyy-MM-dd HH:mm')- unix_timestamp(applytime,'yyyy-MM-dd HH:mm')/60,checkuser from tableau.home_person_check_time limit 10;原创 2020-07-13 15:27:13 · 11533 阅读 · 1 评论 -
hive 使用的小命令
hive cli 中 使用shell命令只要命令前加!并且以;结尾就可以了hive> > !pwd;/data/home/dwhive> 在hive内使用hadoop 的dfs 命令hive> dfs -ls;Found 14 itemsdrwx------ - dw dw 0 2020-03-18 08:0...原创 2020-03-18 11:26:15 · 2793 阅读 · 0 评论 -
hue 小小优化
/build/env/bin/hue close_queries 0 清理hue请求/build/env/bin/hue close_sessions 0 hive 清理hue h2 sessions原创 2019-12-06 10:58:48 · 3340 阅读 · 0 评论 -
hive get_json_object 使用笔记
原数据:[{"s_id":"0","s_name":"NEW"},{"s_id":"0","s_name":"A"}]使用方法hive ①:get_json_object(translate(translate(ab_test,'}{',''),'[|]','{|}'),'$.name')结果 Atranslate(ab_test,'}{','') ==>["s_id":...原创 2019-11-25 16:36:03 · 2957 阅读 · 0 评论 -
Hive.GROUPING SETS
干货Aggregate Query with GROUPING SETSEquivalent Aggregate Query with GROUP BYSELECT a, b, SUM(c) FROM tab1 GROUP BY a, b GROUPING SETS ( (a,b) )SELECT a, b, SUM(c) FROM tab1 GROUP BY a, bSELECT a, b, S...原创 2018-07-04 18:05:55 · 3610 阅读 · 0 评论 -
Hive常用高级函数整合
select post_id, concat_ws(',',collect_set(tag_name)) tag_name from ( select post_id, tagid tag_id from ods.ods_remymartin_rtm_post lateral view explode(split(substring(post_tag,2,length(post_ta原创 2018-06-08 17:46:06 · 14607 阅读 · 0 评论 -
hive find_in_set,get_json_object,lateral view explode函数
今天写几个hive函数, find_in_set,get_json_object,lateral view explode,方便以后查找话不多说开干。find_in_set函数说两点1.使用方法FIND_IN_SET(str,strlist) SELECT FIND_IN_SET('b','a,b,c,d'); -> 2 SELECT FIND_IN_SET('e','a...原创 2018-05-14 11:00:02 · 6217 阅读 · 0 评论 -
hive的静态分区和动态分区
文章来自:https://blog.youkuaiyun.com/gavin_chun/article/details/78174492一、静态分区 1、创建分区表hive (default)> create table order_mulit_partition( > order_number string, > event_time...转载 2018-05-02 19:58:53 · 3971 阅读 · 0 评论