Created
October 1, 2013 07:36
-
-
Save JensRantil/6775021 to your computer and use it in GitHub Desktop.
Generate a parametrized Disco job. See http://disco.readthedocs.org/en/latest/start/tutorial_2.html for example of class based map reduce jobs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_job(param): | |
"""Generate a job the yields only rows identical to `param`.""" | |
class CsvInnerJoiner(Job): | |
def map(self, rows, params): | |
for row in rows: | |
if row == param: | |
yield row, "found" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment