标签:input select com name exe byte 存储 bsp 个数
Hive 的存储格式 | textfile | sequencefile | rcfile | orc | parquet |
行式存储
二进制的k-v对,行式存储
配置块压缩
SET hive.exec.compress.output=true;
SET io.seqfile.compression.type=BLOCK;
列式存储
先将数据进行横切(4M),成为行组,行组内又纵向切割分为多个字段
列式存储
比 rc 文件更大的块(256M),优化磁盘的线性读取,通过指定的编码器确定数据类型并优化压缩
还存储了基本统计数据,比如 min,max,sum,count。。。
列式存储
适用范围更广(在 Hadoop 生态系统中)
适用于嵌套文件格式
设置 Hive自动使用本地模式
SET hive.exec.mode.local.auto=true;
输入文件大小低于此值会进入本地模式
SET hive.exec.mode.local.auto.inputbytes.max=500000000;
输入文件个数低于此值会进入本地模式
SET hive.exec.mode.local.auto.input.files.max=5;
设置seqFile使用块压缩
SET hive.exec.compress.output=true; SET io.seqfile.compression.type=BLOCK;
create table user_seq(id int, name string, pass string, email string, nickname string) stored as SEQUENCEFILE; create table user_rc(id int, name string, pass string, email string, nickname string) stored as rcfile; create table user_orc2(id int, name string, pass string, email string, nickname string) stored as orc tblproperties("orc.compress"="ZLIB"); create table user_parquet2(id int, name string, pass string, email string, nickname string) stored as parquet tblproperties("parquet.compression"="GZIP");
导入大文件
load data local inpath ‘/home/centos/files/user_nopar.txt‘ into table user_nopar;
插入数据
insert into user_seq select * from user_nopar; insert into user_rc select * from user_nopar; insert into user_orc2 select * from user_nopar; insert into user_parquet2 select * from user_nopar;
标签:input select com name exe byte 存储 bsp 个数
原文地址:https://www.cnblogs.com/share23/p/10260168.html