how to change the datatype of mapper input key?

Free Online Certification Courses – Learn Today. Lead Tomorrow. Forums Apache Hadoop how to change the datatype of mapper input key?

Viewing 1 reply thread
  • Author
    Posts
    • #5698
      DataFlair TeamDataFlair Team
      Spectator

      how to change the datatype of mapper input key?

    • #5702
      DataFlair TeamDataFlair Team
      Spectator

      The mapperclass definition is as follows :
      Class Mapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

      KEYIN = Mapper input key ( input for Mapper )
      VALUEIN = Mapper input value ( input for Mapper )
      KEYOUT = Mapper output key ( Output of Mapper, input of Reducer)
      VALUEOUT = Mapper output value ( Output of Mapper, input to Reducer)

      The class definition has both the input and output type. Here we specify the datatypes.
      So to change the datatype of mapper input key , you will need to change the definition of your mapper class

      e.g : public class UserMapper extends Mapper<LongWritable, Text, Text, IntWritable>
      so the input key is LongWritable , here if we wanty we can change mapper input key to any other desired datatype.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.