
# TEXTFILE类型文件使用ARC4压缩时查询结果乱码
#### 问题现象
Hive查询结果表做压缩存储（ARC4），对结果表做select \* 查询时返回结果为乱码。
#### 可能原因
Hive默认压缩格式不是ARC4格式或者未开启输出压缩。
#### 解决方案
1. 在select结果乱码时，在beeline中进行如下设置。 
   **set mapreduce.output.fileoutputformat.compress.codec=org.apache.hadoop.io.encryption.arc4.ARC4BlockCodec;**
   **set hive.exec.compress.output=true;**
   
   
2. 使用块解压的方式先将表导入一个新表中。 
   **insert overwrite table tbl_result select \* from tbl_source;**
   
   
3. 再进行查询。 
   **select \* from tbl_result;**
   
   
 
