随笔分类 -  Hive

摘要:一、引用 <dependency> <groupId>org.apache.hive</groupId> <artifactId>hive-exec</artifactId> <version>1.2.1</version> </dependency> <!-- https://mvnreposit 阅读全文
posted @ 2024-12-31 14:13 Robots2 阅读(28) 评论(0) 推荐(0)
摘要:一、日志 1、hivemetastore日志 简介:查看运行情况,其它组件会通过hivemetastore获取表信息 tail -f /data/emr/hive/logs/hadoop-hivemetastore 二、连接 1、登录hive客户端(指定hivemetastore地址) hive - 阅读全文
posted @ 2024-05-13 18:38 Robots2 阅读(53) 评论(0) 推荐(0)
摘要:一、假数据解析 SELECT r1.col.dataSourceId, r1.col.database, r1.col.dataTable FROM (SELECT explode(r.json) AS col FROM ( SELECT from_json('[{"dataSourceId":4, 阅读全文
posted @ 2023-12-20 14:43 Robots2 阅读(443) 评论(0) 推荐(0)
摘要:一、简介 因hive表删除后,hdfs文件会先放入回收站,定期清理回收站。在回收之前可以进行清理数据 二、恢复步骤 2.1 看表存储是否损坏select type from dw.ods_test1 group by type 2.2 查看表hdfs文件存储位置 show create table 阅读全文
posted @ 2022-07-18 17:08 Robots2 阅读(828) 评论(0) 推荐(0)
摘要:简介:HIVE提供了EXPLAIN命令来展示一个查询的执行计划,这个执行计划对于我们了解底层原理,hive 调优,排查数据倾斜等很有帮助 一、EXPLAIN 参数介绍 语法 : EXPLAIN [EXTENDED|CBO|AST|DEPENDENCY|AUTHORIZATION|LOCKS|VECT 阅读全文
posted @ 2022-06-28 15:51 Robots2 阅读(859) 评论(0) 推荐(0)
摘要:一、join优化 1. 使用相同的连接键当对3个或者更多个表进行join连接时,如果每个on子句都使用相同的连接键的话,那么只会产生一个MapReduce job。 2. 尽量尽早地过滤数据减少每个阶段的数据量,对于分区表要加分区,同时只选择需要使用到的字段。 3. 尽量原子化操作尽量避免一个SQL 阅读全文
posted @ 2022-06-14 16:21 Robots2 阅读(892) 评论(0) 推荐(0)
摘要:一、准备工作 1.1 下载地址 https://github.com/apache/hive https://dlcdn.apache.org/hive/ 版本:2.3.9 1.2 环境依赖 hadoop2.x mysql maven java8 1.3 Idea插件 需要在idea中搜索安装ANT 阅读全文
posted @ 2022-05-07 19:51 Robots2 阅读(148) 评论(0) 推荐(0)
摘要:一、网上总结的报错 1、coalesce报错 FAILED: SemanticException [Error 10014]: Line 197:4 Wrong arguments ''10'': Unsafe compares BETWEEN different types are disable 阅读全文
posted @ 2022-04-01 20:00 Robots2 阅读(1543) 评论(0) 推荐(0)
摘要:一、常用优化 1、每个查询最大使用内存1T,目前配置 3T query.max-memory=1T 2、每个工作节点最多加载10GB数据,目前 60GB query.max-memory-per-node=60GB 3、每个查询最多运行30分钟,目前没设置 query.max-run-time=30 阅读全文
posted @ 2022-03-29 14:36 Robots2 阅读(362) 评论(0) 推荐(0)
摘要:一、基本资料 1、官方文档 https://prestodb.github.io/docs/current/sql/select.html 二、常用命令 1、kill任务,登录presto客户端 CALL system.runtime.kill_query(query_id => '20220317 阅读全文
posted @ 2022-03-17 16:46 Robots2 阅读(495) 评论(0) 推荐(0)
摘要:一、修改表结构 1、添加删除分区 添加分区:alter table app.app_tabe1 add if not exists partition(dt = '20210621', hour = '17'); 删除分区:alter table app.app_tab1 drop partitio 阅读全文
posted @ 2021-09-02 20:48 Robots2 阅读(128) 评论(0) 推荐(0)
摘要:一、建表语句 create table target_tab( version_flag bigint comment '版本标签 2:web延迟 3ios直播延迟 4安卓直播延迟', query_version string comment '查询版本号', is_video int commen 阅读全文
posted @ 2021-08-26 15:28 Robots2 阅读(28) 评论(0) 推荐(0)
摘要:一、建表语句 create table dws_bhv_habo_measure_lostrate_mb_di( version_flag bigint comment '版本标签 2:web丢失 3ios直播丢失 4安卓直播丢失', query_version string comment '查询 阅读全文
posted @ 2021-08-26 15:25 Robots2 阅读(119) 评论(0) 推荐(0)
摘要:模型代码,解析json和打标签 一、建表语句 create table target_tab( event_time bigint comment '事件时间', event_timestamp bigint comment '事件时间戳', video_time bigint comment '直 阅读全文
posted @ 2021-08-26 15:21 Robots2 阅读(143) 评论(0) 推荐(0)
摘要:一、基础信息 下载地址:http://archive.apache.org/dist/hive/ 版本:hive3.1.1 依赖:hadoop3.2.1、mysql 解压目录:/Users/robots2/softWare 二、配置文件修改 1、hive-site.xml cp hive-defau 阅读全文
posted @ 2021-07-29 14:26 Robots2 阅读(145) 评论(0) 推荐(0)