0
from mrjob.job import job
class KittyJob(MRJob):
OUTPUT_PROTOCOL = JSONValueProtocol
def mapper_cmd(self):
return "grep kitty"
def reducer(self, key, values):
yield None, sum(1 for _ in values)
if __name__ == '__main__':
KittyJob().run()
來源:https://mrjob.readthedocs.org/en/latest/guides/writing-mrjobs.html#protocols這個MRJob例子說明
請問這個代碼做了計算含貓咪的行數的任務嗎?
另外在哪裏定義了OUTPUT_PROTOCOL?