summaryrefslogtreecommitdiff
path: root/hadoop/streaming/test/test.sh
blob: 2f09bacfdab6629df535952dd1922827760e0a3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh


hadoop dfs -put input input

HADOOP_HOME=/usr/lib/hadoop
HADOOP_VERSION=0.20.2-cdh3u1
JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar
HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR"

OUT=test_out

$HSTREAMING \
    -input input \
    -output $OUT \
    -mapper /bin/cat \
    -jobconf "mapred.reduce.tasks=3" \
    -reducer org.apache.hadoop.mapred.lib.IdentityReducer

hadoop dfs -get $OUT .
hadoop dfs -rmr $OUT
hadoop dfs -rm input