随笔分类 -  Hive

摘要:1. 报错信息[2022-01-29 16:58:29.312]Container [pid=11436,containerID=container_1642484815040_0052_01_000012] is running 348617216B beyond the 'VIRTUAL' me 阅读全文
posted @ 2022-01-29 18:34 学而不思则罔! 阅读(195) 评论(0) 推荐(0) 编辑
摘要:1. 什么是分桶表-- 根据指定的分桶字段 和 分桶数,将数据划分成 不同的数据文件-- hash(分桶字段) % 分桶数 = 文件分桶编号2. 分桶和分区的区别-- 1. 分桶针对 数据文件进行 拆分-- 分区针对 数据文件存储路径进行 拆分-- 2. 分区字段 并不是数据文件的一部分-- 分桶字 阅读全文
posted @ 2022-01-29 18:30 学而不思则罔! 阅读(213) 评论(0) 推荐(0) 编辑
摘要:1. 什么是分区 1. Hive 中的分区就是 分目录(对数据文件) (表 = 目录,分区 = 目录)2. 为什么创建分区(分区的好处) 1. 数据隔离&查询优化3. 单分区 -- 单分区 -- 创建分区表(单个分区) create table home.ods_front_log_dd ( log 阅读全文
posted @ 2022-01-29 17:31 学而不思则罔! 阅读(499) 评论(0) 推荐(0) 编辑
摘要:1. order by(全局排序) 1. 全局排序, 无论设置多少个 reduce个数,只会产生一个reduce 2. 对大规模的数据集,全局排序效率非常低 1. 设置分区个数为 3 set mapreduce.job.reduces=3; 2. 运行sql select name ,num fro 阅读全文
posted @ 2022-01-29 11:41 学而不思则罔! 阅读(312) 评论(0) 推荐(0) 编辑
摘要:1. like 和 rlike 的区别 1. like 1. sql语法的 模糊匹配 2. 通配符 1. % 代表零个或任意字符 2. _ 代表1个字符 2. rlike 1. hive 扩展功能, 通过 Java 正则表达式 来匹配条件 3. 案例 -- like _单个字符 %任意字符+任意数量 阅读全文
posted @ 2022-01-28 17:03 学而不思则罔! 阅读(4073) 评论(0) 推荐(0) 编辑
摘要:1. where 和 having的区别 1. 使用位置 1. where 只能在group by 之前使用,且不能对 分组函数做限制 2. having 只能在 group by 之后使用,可以对 分组维度字段, 和分组函数 做限制 2. 使用别名 1. where 不能使用别名 2. havin 阅读全文
posted @ 2022-01-28 16:59 学而不思则罔! 阅读(82) 评论(0) 推荐(0) 编辑
摘要:-- 1. 将查询结果导出到 本地 insert overwrite local directory '/root/sanguo4' row format delimited fields terminated by ',' -- 不指定时 使用默认分隔符 stored as textfile -- 阅读全文
posted @ 2022-01-28 16:27 学而不思则罔! 阅读(216) 评论(0) 推荐(0) 编辑
摘要:--1. 语法load data [local] inpath '数据的 path' [overwrite] into table student [partition (partcol1=val1,...)] local : 表示 本地路径,不加local 表示 hdfs路径 overwrite 阅读全文
posted @ 2022-01-28 07:46 学而不思则罔! 阅读(61) 评论(0) 推荐(0) 编辑
摘要:--1. 修改表名 ALTER TABLE person RENAME TO personNew;--2. 修改字段名称、类型、注释、顺序 ALTER TABLE table_name CHANGE [COLUMN] col_old_name col_new_name column_type [CO 阅读全文
posted @ 2022-01-27 19:07 学而不思则罔! 阅读(320) 评论(0) 推荐(0) 编辑
摘要:1. 起因 hive --service hiveserver2 报错, 导致hiveserver2 服务无法使用 2. 报错信息 Exception in thread "HiveServer2-Handler-Pool: Thread-556" java.lang.OutOfMemoryErro 阅读全文
posted @ 2022-01-27 17:04 学而不思则罔! 阅读(867) 评论(0) 推荐(0) 编辑
摘要:1. 触发报错 1. 连接beeline 执行命令 : Connecting to jdbc:hive2://node1:10000/default 2. 报错信息 [root@gaocun bin]# beeline -u jdbc:hive2://gaocun:10000/default -n 阅读全文
posted @ 2022-01-21 10:00 学而不思则罔! 阅读(788) 评论(0) 推荐(0) 编辑
摘要:1. 触发报错 1. hive 启动 2. 初始化元数据库(derby) bin/schematool -dbType derby -initSchema 2. 报错信息 Exception in thread "main" java.lang.NoSuchMethodError: com.goog 阅读全文
posted @ 2022-01-19 17:21 学而不思则罔! 阅读(810) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示