Sqoop tutorial 8 : Compressing Imported Data
Use the parameter --compress to enable compression:
sqoop import \
--connect jdbc:mysql://mysql.example.com/sqoop \
--username sqoop \
--table cities \
--compress
By default, when using the --compress parameter, output files will be compressed using the GZip codec, and all files will end up with a .gz extension. You can choose any other codec using the --compression-codec parameter. The following example uses the BZip2 codec instead of GZip
sqoop import --compress \
--compression-codec org.apache.hadoop.io.compress.BZip2Codec
sqoop import \
--connect jdbc:mysql://mysql.example.com/sqoop \
--username sqoop \
--table cities \
--compress
By default, when using the --compress parameter, output files will be compressed using the GZip codec, and all files will end up with a .gz extension. You can choose any other codec using the --compression-codec parameter. The following example uses the BZip2 codec instead of GZip
sqoop import --compress \
--compression-codec org.apache.hadoop.io.compress.BZip2Codec
Comments
Post a Comment