Write text from comand string in Hadoop

Can I write text from the command line in Hadoop?

Trying to do something similar to the unix write / append to file command.

echo "hello world" > hello_world.txt 

In the land of Hadoop, I would expect this to work, but the teams do not.

 hadoop fs -appendToFile "foo bar" /dir/hadoop/hello_world.txt hadoop fs -put "hello world" /dir/hadoop/hello_world.txt 
+5
source share
1 answer

Hadoop docs appendToFile and put can read stdin

echo "hello world" | hadoop fs -appendToFile - /dir/hadoop/hello_world.txt

echo "hello world" | hadoop fs -put - /dir/hadoop/hello_world.txt

+18
source

All Articles