-1

I have a mrjob program, and just get data from sql database, so I don't need read local file or any input file, however mrjob forces me to 'reading from STDIN', so I just create an empty file as input file. It's really ugly, is there a way to run the job with no input files?

3 Answers3

2

Have you tried piping the output from mysql to mrjob? Something like:

mysql -D database -u user < test.sql | python mrjob_script.py
Narek
  • 548
  • 6
  • 26
0

Go here and look for the section called "file options." that should get you started.

offwhitelotus
  • 1,049
  • 9
  • 15
0

How about just use /dev/null? It doesn't remove the input requirement, but you don't need to create an empty file every time, it is always there.

python your_mr_job.py /dev/null
Andy
  • 1,231
  • 1
  • 15
  • 27