Mapper class not found

前端 未结 2 490
醉话见心
醉话见心 2021-02-06 18:01

Sometimes my MR job complains that MyMapper class in not found. And that i have to give job.setJarByClass(MyMapper.class); to tell it to load it from my jar file.

cloude

2条回答
  •  终归单人心
    2021-02-06 18:32

    Yes, job.setJarByClass is necessary. So that hadoop will copy your jar to the task trackers. If you does not invoke job.setJarByClass, hadoop will think your jar is in the classpath of task trackers, so it does not copy your jar.

提交回复
热议问题