表创建期间的配置单元压缩与配置单元会话压缩参数值

qhhrdooz  于 2021-05-27  发布在  Hadoop
关注(0)|答案(0)|浏览(229)

即使我在创建表的过程中使用特定的压缩创建配置单元表(包括内部和外部),但在加载数据(插入到表选择中)时,配置单元会话压缩参数会覆盖在创建表的过程中设置的压缩值,如何避免这种情况?
表格创建method:1 with 快速压缩

create external table someschema.table1(
id int,
firstname string,
lastname string,
)
row format delimited 
fields terminated by ','
STORED AS INPUTFORMAT  'org.apache.hadoop.io.compress.SnappyCodec'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
location '/user/cloudera/table1'

表格创建method:2 with bzip压缩

create external table hiveschema.table2(
id int,
firstname string,
lastname string)
row format delimited 
fields terminated by ','
stored as textfile
location '/user/cloudera/table2'
TBLPROPERTIES ("orc.compress"="BZIP")

会话参数在表级别重写压缩集

SET mapreduce.output.fileoutputformat.compress.codec=<some compression codec>
SET hive.exec.compress.output=true;
SET mapreduce.output.fileoutputformat.compress=true;

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题