Skip to content

Instantly share code, notes, and snippets.

@JensRantil
Created October 1, 2013 07:36
Show Gist options
  • Save JensRantil/6775021 to your computer and use it in GitHub Desktop.
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.
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