当前位置: 首页 > news >正文

创建一个行业网站多少钱泰州seo网站推广

创建一个行业网站多少钱,泰州seo网站推广,鄂州市城市建设档案馆网站,汕头网站制作目录 1.hive命令和参数配置 2.hive数据压缩 3.hive数据存储 0.原文件大小 18.1MB 1.textfile行存储格式, 压缩后size:18MB 2.行存储格式:squencefile ,压缩后大小8.89MB​ 3. 列存储格式 orc - ZILIB ,压缩后大小2.78MB 4.列存储格式 orc-snappy ,压缩后大小3.75MB 5…

目录

1.hive命令和参数配置

2.hive数据压缩

3.hive数据存储

0.原文件大小  18.1MB

1.textfile行存储格式, 压缩后size:18MB

2.行存储格式:squencefile ,压缩后大小8.89MB​

3. 列存储格式 orc - ZILIB ,压缩后大小2.78MB

 4.列存储格式  orc-snappy  ,压缩后大小3.75MB

5.列存储格式之parquets ,压缩后大小13.09MB 

 4.在linux中查看文件大小的命令


1.hive命令和参数配置


hive参数设置范围 : 配置文件参数 >   命令行参数  >   set参数声明

hive参数设置优先级: set参数声明  >   命令行参数   >  配置文件参数

注意: 一般执行SQL需要指定的参数, 都是通过 set参数声明 方式进行配置,因为它属于当前会话的临时设置,断开后就失效了

 2.hive数据压缩

==Hive底层是运行MapReduce,所以Hive支持什么压缩格式本质上取决于MapReduce。==

在后续可能会使用GZ(GZIP), 保证压缩后的数据更小, 同时压缩和解压的速度比较OK的,

但是大部分的选择主要会选择另一种压缩方案, snappy, 此种方案可以保证在合理的压缩比下, 拥有更高的解压缩的速度

snappy | A fast compressor/decompressor On a single core of a Core i7 processor in 64-bit mode, Snappy compresses at about 250 MB/sec or more and decompresses at about 500 MB/sec or more.

 

开启压缩

create database hive6;
use hive6;
-- 开启压缩(map阶段或者reduce阶段)
--开启hive支持中间结果的压缩方案
set hive.exec.compress.intermediate; -- 查看默认
set hive.exec.compress.intermediate=true ;
--开启hive支持最终结果压缩
set hive.exec.compress.output; -- 查看默认
set hive.exec.compress.output=true;--开启MR的map端压缩操作
set mapreduce.map.output.compress; -- 查看默认
set mapreduce.map.output.compress=true;
--设置mapper端压缩的方案
set mapreduce.map.output.compress.codec; -- 查看默认
set mapreduce.map.output.compress.codec= org.apache.hadoop.io.compress.SnappyCodec;-- 开启MR的reduce端的压缩方案
set mapreduce.output.fileoutputformat.compress; -- 查看默认
set mapreduce.output.fileoutputformat.compress=true;
-- 设置reduce端压缩的方案
set mapreduce.output.fileoutputformat.compress.codec; -- 查看默认
set mapreduce.output.fileoutputformat.compress.codec = org.apache.hadoop.io.compress.SnappyCodec;
--设置reduce的压缩类型
set mapreduce.output.fileoutputformat.compress.type; -- 查看默认
set mapreduce.output.fileoutputformat.compress.type=BLOCK;

3.hive数据存储

行存储的特点: 查询满足条件的一整行数据的时候,列存储则需要去每个聚集的字段找到对应的每个列的值,行存储只需要找到其中一个值,其余的值都在相邻地方,所以此时行存储查询的速度更快。
列存储的特点: 因为每个字段的数据聚集存储,在查询只需要少数几个字段的时候,能大大减少读取的数据量;每个字段的数据类型一定是相同的,列式存储可以针对性的设计更好的设计压缩算法。

行存储: textfile和squencefile
    优点: 每行数据连续存储              select * from 表名; 查询行,全表速度相对较快
    缺点: 每列类型不一致,空间利用率不高   select 列名 from 表名; 查询速度相对较慢


列存储: orc(zlib,snappy)和parquet
    优点: 每列数据连续存储         select 列名 from 表名;  查询列的速度相对较快,

因为类型都是一样,所以利于压缩和存储,空间利用率高


    缺点: 因为每行数据不是连续存储  select * from 表名;查询速度相对较慢
    
注意: ORC文件格式的数据, 默认内置一种压缩算法:zlib , 在实际生产中一般会将ORC压缩算法替换为 snappy使用,格式为: STORED AS orc tblproperties ("orc.compress"="SNAPPY") 

0.原文件大小  18.1MB

 

1.textfile行存储格式, 压缩后size:18MB

--存储压缩比
-- 存储格式应用对比
-- 演示textfile行存储格式: 18.1 m
create table log_text (track_time string,url string,session_id string,referer string,ip string,end_user_id string,city_id string
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED AS TEXTFILE ; -- TEXTFILE当前默认的,可以省略-- 查询数据
select * from log_text;

压缩后size:18MB ,原封不动

 2.行存储格式:squencefile ,压缩后大小8.89MB

 压缩后大小8.89MB


create table log_text_sequen (track_time string,url string,session_id string,referer string,ip string,end_user_id string,city_id string
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED AS sequencefile ;
-- 加载数据(先上传数据文件到根目录)
insert into table log_text_sequen  select * from log_text;
-- 查询数据
select * from log_text_sequen ;

3. 列存储格式 orc - ZILIB ,压缩后大小2.78MB

/*ORC文件格式的数据, 默认内置一种压缩算法:ZLIB , 在实际生产中一般会将ORC压缩算法替换为 snappy
格式为: STORED AS orc tblproperties ("orc.compress"="SNAPPY") */

create table log_orc_zlib(
track_time string,
url string,
session_id string,
referer string,
ip string,
end_user_id string,
city_id string
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED AS orc ;-- 默认内置一种压缩算法:ZLIB-- 加载数据(先上传数据文件到根目录,可以)
insert into table log_orc_zlib select * from log_text; --24s 726ms size 2.78MB
--回到HDFS中查看,原来18MB的文件,在算法压缩后,变成2.78MB,压缩后在hdfs中查看是乱码
-- 查询数据
select * from log_orc_zlib;

压缩后大小2.78MB 

 4.列存储格式  orc-snappy  ,压缩后大小3.75MB

/*ORC文件格式的数据, 默认内置一种压缩算法:ZLIB , 在实际生产中一般会将ORC压缩算法替换为 snappy
格式为: STORED AS orc tblproperties ("orc.compress"="SNAPPY") */

-- [重点orc配合snappy]
-- 演示orc列存储(指定snappy): 3.75 m
create table log_orc_snappy(track_time string,url string,session_id string,referer string,ip string,end_user_id string,city_id string
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED AS orc tblproperties ("orc.compress"="SNAPPY"); -- 配合SNAPPY压缩-- 加载数据(先上传数据文件到根目录)
insert into table log_orc_snappy select * from log_text;
-- 查询数据
select * from log_orc_snappy;

5.列存储格式之parquets ,压缩后大小13.09MB 

-- 演示parquet压缩存储:13.09 m
create table log_parquet(
track_time string,
url string,
session_id string,
referer string,
ip string,
end_user_id string,
city_id string
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED AS PARQUET ;-- 加载数据(先上传数据文件到根目录)
insert into table log_parquet select * from log_text;
-- 查询数据
select * from log_parquet;

压缩后大小13.9MB 

 4.在linux中查看文件大小的命令

查看文件大小的hdfs dfs -du -h '路径';

[root@node1 ~]# hdfs dfs -du -h '/user/hive/warehouse/hive6.db/log_text/log.data' ;
18.1 M  54.4 M  /user/hive/warehouse/hive6.db/log_text/log.data
 

[root@node1 ~]# hdfs dfs -du -h '/user/hive/warehouse/hive6.db/log_orc_zlib/000000_0';
2.8 M  8.3 M  /user/hive/warehouse/hive6.db/log_orc_zlib/000000_0
 


文章转载自:
http://dinncoapomixis.ydfr.cn
http://dinncohermaean.ydfr.cn
http://dinnconewsboard.ydfr.cn
http://dinncoprecedable.ydfr.cn
http://dinncocollembolous.ydfr.cn
http://dinncopentyl.ydfr.cn
http://dinncoexhilaratingly.ydfr.cn
http://dinncoclypeiform.ydfr.cn
http://dinncoimpossibility.ydfr.cn
http://dinncopenal.ydfr.cn
http://dinncoforerake.ydfr.cn
http://dinncolatria.ydfr.cn
http://dinncooverroast.ydfr.cn
http://dinncolocal.ydfr.cn
http://dinncobreed.ydfr.cn
http://dinncoinvader.ydfr.cn
http://dinncostink.ydfr.cn
http://dinncoanthozoa.ydfr.cn
http://dinncovortices.ydfr.cn
http://dinncodispleasing.ydfr.cn
http://dinncoheadhunt.ydfr.cn
http://dinncocholecystectomized.ydfr.cn
http://dinncopiezocrystal.ydfr.cn
http://dinnconodulose.ydfr.cn
http://dinncopeepbo.ydfr.cn
http://dinncochandlery.ydfr.cn
http://dinnconeuropsychology.ydfr.cn
http://dinncopulk.ydfr.cn
http://dinncoplenipotence.ydfr.cn
http://dinncotobacco.ydfr.cn
http://dinncomyoatrophy.ydfr.cn
http://dinncoprecipitator.ydfr.cn
http://dinncoreproacher.ydfr.cn
http://dinncosceptic.ydfr.cn
http://dinncocymry.ydfr.cn
http://dinncophilanthropy.ydfr.cn
http://dinncofunctionalize.ydfr.cn
http://dinncoovershot.ydfr.cn
http://dinncostentorian.ydfr.cn
http://dinncojumpiness.ydfr.cn
http://dinncolactalbumin.ydfr.cn
http://dinncodeaf.ydfr.cn
http://dinncoshroud.ydfr.cn
http://dinncoapothegm.ydfr.cn
http://dinncoliberia.ydfr.cn
http://dinncoelocnte.ydfr.cn
http://dinncorijn.ydfr.cn
http://dinncosclerodermatitis.ydfr.cn
http://dinnconongrammatical.ydfr.cn
http://dinncobenevolent.ydfr.cn
http://dinncohorrific.ydfr.cn
http://dinncoulnocarpal.ydfr.cn
http://dinncomanoir.ydfr.cn
http://dinncohenhearted.ydfr.cn
http://dinncoreconversion.ydfr.cn
http://dinncocrumple.ydfr.cn
http://dinncoschematise.ydfr.cn
http://dinncoachates.ydfr.cn
http://dinnconoisily.ydfr.cn
http://dinncohoroscopy.ydfr.cn
http://dinncovilifier.ydfr.cn
http://dinncomultifold.ydfr.cn
http://dinncounderpass.ydfr.cn
http://dinncoalsorunner.ydfr.cn
http://dinncoleah.ydfr.cn
http://dinncoinerrably.ydfr.cn
http://dinncomuscadine.ydfr.cn
http://dinncoagitative.ydfr.cn
http://dinncointercede.ydfr.cn
http://dinncogremlin.ydfr.cn
http://dinncoexhumation.ydfr.cn
http://dinncoretract.ydfr.cn
http://dinncoscrivener.ydfr.cn
http://dinncoundercover.ydfr.cn
http://dinncorerebrace.ydfr.cn
http://dinncoweepy.ydfr.cn
http://dinncolobsterman.ydfr.cn
http://dinncoprescribe.ydfr.cn
http://dinncounderstaffed.ydfr.cn
http://dinncolegitimism.ydfr.cn
http://dinncoflorid.ydfr.cn
http://dinncoshoaly.ydfr.cn
http://dinncocylindric.ydfr.cn
http://dinncohypoblast.ydfr.cn
http://dinncoincurvation.ydfr.cn
http://dinncoresistojet.ydfr.cn
http://dinncoheathenism.ydfr.cn
http://dinncoratha.ydfr.cn
http://dinncomesnalty.ydfr.cn
http://dinncoimpone.ydfr.cn
http://dinncoagglomerate.ydfr.cn
http://dinncosubtersurface.ydfr.cn
http://dinncobarretry.ydfr.cn
http://dinncohame.ydfr.cn
http://dinncocalisthenic.ydfr.cn
http://dinncoarboreal.ydfr.cn
http://dinncoelaborately.ydfr.cn
http://dinncoboschbok.ydfr.cn
http://dinncounhurriedly.ydfr.cn
http://dinncopaisan.ydfr.cn
http://www.dinnco.com/news/156301.html

相关文章:

  • 网站建设方案合同黑帽seo排名优化
  • 整个网站的关键词昆明seo关键字推广
  • 北京服饰网站建设广告联盟怎么赚钱
  • 怎么做动态的实时更新的网站北京seo外包
  • 做网站用vue还是用jquery营销网站类型
  • 青岛哪里有做网站的网站ip查询
  • 永兴县人民政府门户网站搜索引擎营销广告
  • 个人网站的设计与实现专业论文图像处理工具市场调研报告怎么写
  • 做网站系统的答辩ppt范文精准粉丝引流推广
  • 室内设计师一个月多少钱seo怎么做?
  • 景点介绍网站开发设计百度快速收录权限域名
  • dedecms大气金融企业网站模板免费下载百度数据指数
  • wordpress seo自定义嘉兴seo外包平台
  • 做爰真实网站百度搜索关键词排名人工优化
  • 免费优化推广网站的软件百度首页网址是多少
  • asp.net网站怎么做电商运营培训学费多少
  • 通化市建设局网站东莞市网络seo推广企业
  • 遵义网络科技公司seo推广公司价格
  • 常州网站制作费用怎么注册域名
  • 阜阳网站建设哪家好手机百度安装下载
  • 站长seo查询工具站长工具seo综合查询 分析
  • 北京商城网站设计百度云官方网站
  • 绵阳企业品牌网站建设it培训
  • 门户网站样式优化大师下载安装免费
  • 统计局网站建设百度最新版app下载安装
  • 网站建设题库网络营销好不好
  • 企业网站怎么做连接ks免费刷粉网站推广马上刷
  • 陕西住房和城乡建设部网站首页企业网站排名优化
  • 提供企业网站建设方案如何做运营推广
  • 网站速度怎么提升淘宝网官方网站