def map_udf(partition):
    """
     Each partition in this pairedRDD is of the following form:
        [
         (index, ([read_1], [read_2])),
         (index, ([read_1], [read_2]))
        ]
    """
    return {'input_1.txt': ('\n'.join(p[1][0]) for p in partition),
            'input_2.txt': ('\n'.join(p[1][1]) for p in partition)}