What is Identity Mapper?

Viewing 2 reply threads
  • Author
    Posts
    • #5546
      DataFlair TeamDataFlair Team
      Spectator

      Explain Identity Mapper in Hadoop?

    • #5548
      DataFlair TeamDataFlair Team
      Spectator

      Identity Mapper is the default Mapper class provided by Hadoop 1.x . This class will be picked automatically when no mapper is specified in MapReduce driver class.

      Identity Mapper class implements identity function, which directly writes all its input key-value pair into output. You can check the implementation of IdentityMapper class in grepcode.com website

      IdentityMapper class is defined in old mapreduce API (MR1) in org.apache.hadoop.mapred.lib package

      From Hadoop 2.x (MR2 or YARN) onwards, it uses Mapper class which is defined in org.apache.hadoop.mapreduce package if you don’t specify any Mapper class in MapReduce drive program

    • #5550
      DataFlair TeamDataFlair Team
      Spectator

      Identity Mapper does not transform the input and return it as it is in Output form. as we are doing in mathematics where Identity function maps every element to itself. It’s just like what 0 does in case of addition and 1 does in case of multiplication.

      It takes the Input key and Value and Splits it out the same Output Key and Value.

      Identity Mapper class implements identity function, which directly writes all its input key-value pair into an output. You can check the implementation of IdentityMapper class in grepcode.com website

      IdentityMapper class is defined in old MapReduce API (MR1) in org.apache.hadoop.mapred.lib package

      To learn more about IdentityMapper visit :Identity Mapper

Viewing 2 reply threads
  • You must be logged in to reply to this topic.