Generating Separate Output files in Hadoop Streaming

hadoop, mapreduce, python, streaming

Solution

You can either write to a text file on the local filesystem using python file functions or if you want to use HDFS use the Thrift API.

Problem

Using only a mapper (a Python script) and no reducer, how can I output a separate file with the key as the filename, for each line of output, rather than having long files of output?

Original source