2.1. Create LZO Files
Create LZO files as the output of the Hive query.
Use
lzo
command utility or your custom Java to generatelzo.index
for the.lzo
files.
Hive Query Parameters
Prefix the query string with these parameters:
SET mapreduce.output.fileoutputformat.compress.codec=com.hadoop.compression.lzo.LzoCodec SET hive.exec.compress.output=true SET mapreduce.output.fileoutputformat.compress=true
For example:
hive -e "SET mapreduce.output.fileoutputformat.compress.codec=com.hadoop.compression.lzo.LzoCodec;SET hive.exec.compress.output=true;SET mapreduce.output.fileoutputformat.compress=true;"