
Hadoop生态圈
文章平均质量分 79
HDP_CDH
数仓小白点滴记忆
展开
-
hive中自增序列,连续登陆及拉链表
1,实现hive中的自增列 假设有维度表tbl_dim和过渡表tbl_stg,现在要将tbl_stg的数据装载到tbl_dim,装载的同时生成维度表的代理键 select row_number() over (order by 1) + t2.sk_max,tbl_stg.name from tbl_stg cross join (select coalesce(max(sk_max),0) sk_max from tbl_dim) t2; 上面语句中,先查询维度表中已...原创 2021-09-02 10:52:07 · 1350 阅读 · 0 评论 -
Hivesql 行转列,列转行详解
hive中行转列 行转列:concat_ws 和collect_set或者collect_list结合使用 collect_set函数是对统计的数据进行去重,然后拼接在一起,返回一个set集合 collect_list是不去重,对所有的值进行拼接然后返回一个list集合 select id,isbook,concat_ws(',', collect_list(cast(time as string))) as List from table group byid,isbook 使用str_..原创 2020-11-13 15:29:35 · 1822 阅读 · 1 评论 -
Mariadb/Mysql升级至10.4.10操作实战
切记:升级操作需要使用yum源 1,备份相关数据库数据 mysqldump -h127.0.0.1 -uroot -ppass --databases hive ambair >/opt/tools/mariadb-10.4.10/ambari-hive.sql 2,卸载原有mariadb数据库 卸载相关rpm包,示例如下 rpm -ivh m...原创 2019-11-27 21:36:13 · 1529 阅读 · 0 评论 -
Hive高频使用
1.强制删除带有表的hive库: drop database 库名 cascade; 2.设置显示当前使用的hive库: hive> set hive.cli.print.current.db=true; 查询当前使用的hive库:select current_database(); 3.hive客户端设置运行队列: hive>s...原创 2018-11-22 10:47:32 · 606 阅读 · 0 评论