summaryrefslogtreecommitdiff
path: root/hadoop/streaming/partitioner_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hadoop/streaming/partitioner_test.sh')
-rwxr-xr-xhadoop/streaming/partitioner_test.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/hadoop/streaming/partitioner_test.sh b/hadoop/streaming/partitioner_test.sh
new file mode 100755
index 0000000..dcc7353
--- /dev/null
+++ b/hadoop/streaming/partitioner_test.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+
+hadoop dfs -put partitioner_test.input partitioner_test.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=partitioner_out
+
+$HSTREAMING \
+ -input partitioner_test.input \
+ -output $OUT \
+ -mapper /bin/cat \
+ -jobconf mapred.reduce.tasks=2
+
+hadoop dfs -get $OUT .
+hadoop dfs -rmr $OUT
+hadoop dfs -rm partitioner_test.input
+