Yelp/mrjob — pull request #637 by ap-ensighten (2013-05-19 01:57:43+00:00)
Title: unable to run non-streaming jar

I've run into some issues when trying to run non-hadoop streaming jar files.

Example for installing Hive:

```
from mrjob.job import MRJob

class InstallHive(MRJob):

def steps(self):
return [self.jar(
name='install hive',
jar='s3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar',
main_class=None,
step_args=[
"s3://us-east-1.elasticmapreduce/libs/hive/hive-script",
"--base-path",
"s3://us-east-1.elasticmapreduce/libs/hive/",
"--install-hive",
"--hive-versions",
"latest"])]

if __name__ == '__main__':
InstallHive.run()
```

Solution:
The first problem was the `_build_jar_step` function had the incorrect signature which would cause an exception before mrjob could submit the job to emr:

```
TypeError: _build_jar_step() takes exactly 2 arguments (4 given)
```

After fixing this the job would run and complete successfully, however an exception would be thrown from `_fetch_counters` afterwards:

```
File "/lib/python2.6/site-packages/mrjob/emr.py", line 1727, in _fetch_counters
lg_step_nums = list(sorted(lg_step_num_mapping[k] for k in step_nums))
File "/lib/python2.6/site-packages/mrjob/emr.py", line 1727, in
lg_step_nums = list(sorted(lg_step_num_mapping[k] for k in step_nums))
KeyError: 18
```

`_fetch_counters` was being passed an empty list for `lg_step_num_mapping` since there was a step run but it was not a log generating step (i.e. not a hadoop streaming step) and the method was only handling the case where `lg_step_num_mapping` was `None`. I think #635 is the same issue.