hi, all:
my case is that I want to select some matched lines from a file and print them into output file. But in the reducer , I finally "yield key, values.netxt()", it can not omit the key( in this file case, the key is the offset of the line in the file". Here is my code .
def mapper(key, value):
import re
if re.compile(r'\d').match(value):
yield key, value
def reducer(key, value):
yield key, value.next()
if __name__ == '__main__':
import dubmo
dubmo.run(mapper, reducer)
and my inputfile is like this:
a
1
3
d
so , I want the output file like this:
1
3
but , the above MR outputs
1, 1
2, 3
Does anyone can help?