Support Questions

Find answers, ask questions, and share your expertise

How to extract Bz file in hdfs

avatar
Expert Contributor

i already try this comment not working fine .....

hadoop fs -unzip /path/fileinRC_2015-01.bz2

hadoop fs -bunzip /path/fileinRC_2015-01.bz2

1 ACCEPTED SOLUTION

avatar
Master Mentor
@sivasaravanakumar k

You would need to do something like this gunzip -c fileinRC_2015-01.bz2 | hadoop fs -put - /path/fileinhdfs

View solution in original post

7 REPLIES 7

avatar
Master Mentor
@sivasaravanakumar k

You would need to do something like this gunzip -c fileinRC_2015-01.bz2 | hadoop fs -put - /path/fileinhdfs

avatar
Master Mentor

avatar
Expert Contributor

i want extract file with in hdfs ...

i dont want extrct the file outside hdfs and put in file again in hdfs ...

avatar
Master Mentor
@sivasaravanakumar k

Try this

hadoop fs -text /hdfs_path/compressed_file.gz | hadoop fs -put -/hdfs_path/uncompressed-file.txt 

avatar
Expert Contributor

Thnks lot

but in ur comment minor correction (-put (space) - (space) after given file path )

hadoop fs -text /hdfs_path/compressed_file.gz | hadoop fs -put - /hdfs_path/uncompressed-file.txt

avatar
Master Mentor

avatar
New Contributor

Thanks, it worked..