blob: 759f823e75681b81e1c634aaaf6c3bbb61e2271f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/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=partitioner_test1_out
$HSTREAMING \
-input input \
-output $OUT \
-mapper /bin/cat \
-jobconf mapred.reduce.tasks=2 \
-partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner \
-jobconf stream.map.output.field.separator="\t" \
-jobconf map.output.key.field.separator=. \
-jobconf stream.num.map.output.key.fields=2 \
-jobconf mapred.text.key.partitioner.options=-k1
hadoop dfs -get $OUT .
hadoop dfs -rmr $OUT
hadoop dfs -rm input
|