01 2022 档案

摘要:--1. 语法 tablesample(bucket x out of y) 注意 : x 必须 <= y--2. 案例select * from home.ods_front_log_dd tablesample(bucket 1 out of 4 on log_id); 阅读全文
posted @ 2022-01-29 18:40 学而不思则罔! 阅读(39) 评论(0) 推荐(0) 编辑
摘要: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 学而不思则罔! 阅读(212) 评论(0) 推荐(0) 编辑
摘要:1. 什么是分区 1. Hive 中的分区就是 分目录(对数据文件) (表 = 目录,分区 = 目录)2. 为什么创建分区(分区的好处) 1. 数据隔离&查询优化3. 单分区 -- 单分区 -- 创建分区表(单个分区) create table home.ods_front_log_dd ( log 阅读全文
posted @ 2022-01-29 17:31 学而不思则罔! 阅读(491) 评论(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 学而不思则罔! 阅读(310) 评论(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 学而不思则罔! 阅读(4050) 评论(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 学而不思则罔! 阅读(215) 评论(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 学而不思则罔! 阅读(60) 评论(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 学而不思则罔! 阅读(319) 评论(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 学而不思则罔! 阅读(862) 评论(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 学而不思则罔! 阅读(784) 评论(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 学而不思则罔! 阅读(807) 评论(0) 推荐(0) 编辑
摘要:1. 什么是三范式-- 设计关系型数据库表时,要想设计一个好的关系,必须使关系满足 一定的约束条件,这些约束条件就是 范式2.为什么设计数据库要遵循 范式 -- 1. 使数据库简洁、结构明晰 -- 2. 不会发生插入、删除、更新操作带来的异常 -- 3. 避免数据冗余3. 范式的种类 -- 第一范式 阅读全文
posted @ 2022-01-14 18:07 学而不思则罔! 阅读(151) 评论(0) 推荐(0) 编辑
摘要:ps 1. 什么进程 程序(例如 二进制文件-binary file)被触发后 执行者的权限 与 属性、程序的代码及所需要的数据都会被加载到内存中 操作系统会给予这个内存单元一个标识符(PID) 可以说进程就是真正运行的程序 当我们执行一个程序时,对于操作系统来讲就是创建了一个进程,在这个过程中,伴 阅读全文
posted @ 2022-01-14 15:58 学而不思则罔! 阅读(314) 评论(0) 推荐(0) 编辑
摘要:1. 输入数据接口 :InputFormat 1. 默认使用的实现类 :TextInputFormat 一次读取一行文本,该行的起始偏移量为key,行内容为value 2. CombineTextInputFormat 可以将多个小文件合并成一个切片处理,提高处理效率 3. 博客连接 https:/ 阅读全文
posted @ 2022-01-05 19:26 学而不思则罔! 阅读(29) 评论(0) 推荐(0) 编辑
摘要:package MapFilterPk { import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.{FSDataInputStream, FileSystem, Path} import org.apache. 阅读全文
posted @ 2022-01-05 18:27 学而不思则罔! 阅读(75) 评论(0) 推荐(0) 编辑
摘要:1. 需求描述 订单数据表 : t_order表 id 订单id pid 产品id amount 产品数量 id pid amount 1001 01 1 1002 02 2 1003 03 3 1004 01 4 1005 02 5 1006 03 6 商品信息表 : t_product表 pid 阅读全文
posted @ 2022-01-05 18:04 学而不思则罔! 阅读(43) 评论(0) 推荐(0) 编辑

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