mrjob: how does the example automatically know how to find lines in text file?
问题 I'm trying to understand the example for mrjob better from mrjob.job import MRJob class MRWordFrequencyCount(MRJob): def mapper(self, _, line): yield "chars", len(line) yield "words", len(line.split()) yield "lines", 1 def reducer(self, key, values): yield key, sum(values) if __name__ == '__main__': MRWordFrequencyCount.run() I run it by $ python word_count.py my_file.txt and it works as expected but I don't get how it automatically knows that it's going to read a text file and split it by