1

I was trying to pass an enum from mapper to reducer, in job conf, I set
job.setMapOutputValueClass(StatisticTypes.class);
and in mapper, I passed a type of this enum, but always get

Type mismatch in value from map: expected StatisticTypes, recieved StatisticTypes$2

It seems like types of this enums were treated as a nested class of the enum
I'm wondering how can I set mapoutputvalueclass to include it's nested classes. Or is it possible to set multiple mapoutput classes?

Another related question
How to set mapOutputValueClass as Enum in hadoop

Han Yu
  • 23
  • 3
  • Have you looked at https://stackoverflow.com/a/23249886/729819 – Ben Watson Mar 22 '18 at 15:58
  • @BenWatson, I did look at that, the problem is not about how to implement writable interface for enums but the type mismatch between enum.class and types of enums.class – Han Yu Mar 22 '18 at 16:20

0 Answers0