Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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

Thanks, it worked..