![](https://img-blog.csdnimg.cn/20201114175421270.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Hive
follow me to read Hive Programming
Jackie_zhihe
职场技术沉淀、分享、
展开
-
hive sql用户留存计算
select first_day, by_day, count(orderid) as total_num_of_orderfrom(select uuid, first_day, activate_day, orderid, datediff(activate_day,first_day) as by_dayfrom (select t1.uuid, from_unixtime(unix_timestamp(t1.dt,'yyyymmdd'),'yyyy-mm-dd.原创 2021-04-22 17:43:12 · 378 阅读 · 0 评论 -
Hive sql产生随机数
cast(ceiling(rand() * 10) as int) as numcast(floor(rand() * 10) as int) as num原创 2021-04-19 14:10:53 · 4465 阅读 · 0 评论 -
hive sql日期转换
regexp_replace(cast(date_sub(from_unixtime(unix_timestamp('${date}','yyyymmdd'),'yyyy-mm-dd'),10) as string),'-','')原创 2021-04-19 10:52:35 · 420 阅读 · 0 评论 -
设置hive执行引擎
1、mapreduce计算引擎(默认)set hive.execution.engine=mr;2、Tez计算引擎set hive.execution.engine=Tez;原创 2021-01-28 14:48:51 · 5137 阅读 · 0 评论 -
Hive sql quick review
part 1:hive sql的连接方式 hive sql 一共三种连接方式,第一种是jdbc的方式,第二种是非常熟知webui的方式,我这里比较常用的是命令行的方式对hive进行一个交互。这里我要介绍的是从文件执行hive sql。具体如下所示:在linux命令行界面,可以直接通过hive + -f + file进行执行hive sql。注:当你在当前sql文件下时,可以需要跟路径,直接进行执行这个sql file。其次,我们需要对执行的sql代码进行传参,这里与上面不一样的是多了一...原创 2020-07-12 16:54:20 · 122 阅读 · 0 评论