You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Sanjay Subramanian <Sa...@wizecommerce.com> on 2013/06/24 22:34:46 UTC

Piping to HDFS (from Linux or HDFS)

Hi guys

While I was trying to get some test data and configurations done quickly I realized one can do this and I think its super cool

Processing existing file on Linux/HDFS and Piping it directly to hdfs

source = Linux  dest=HDFS
======================
File = sanjay.conf.template
We want to replace one line in the file 9999-99-99 ----> 1947-08-15
DATE_STR=9999-99-99

cat sanjay.conf.template | sed 's/9999-99-99/1947-08-15/g' | hdfs dfs -put - /user/sanjay/sanjay.conf

source = HDFS  dest=HDFS
======================
hdfs dfs -cat  /user/nextag/sanjay.conf.template  | sed 's/9999-99-99/1947-08-15/g' | hdfs dfs -put - /user/sanjay/1947-08-15/nextag.conf


Thanks

sanjay

CONFIDENTIALITY NOTICE
======================
This email message and any attachments are for the exclusive use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message along with any attachments, from your computer system. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator.