Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HDFS >> mail # user >> Piping to HDFS (from Linux or HDFS)


Copy link to this message
-
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.