@tsing1226
2015-12-12T23:02:04.000000Z
字数 729
阅读 2067
create table page_views_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") ;
insert into table page_views_orc_snappy select * from page_views ;
create table page_views_parquet_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 PARQUET ;
set parquet.compression=SNAPPY ;-->使用Snappy设置
insert into table page_views_parquet_snappy select * from page_views ;
总结:在实际项目开发中,hive表的数据的存储格式为:orc / parquet,压缩使用的是Snappy。