Hadoop

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

      We have a 400MB file containing single line of data and the HDFS block size is 128MB. How many mappers do we need to read the file?

    • #5455
      DataFlair TeamDataFlair Team
      Spectator

      You can calculate the No. of Mappers using the following reference.

      No. of mappers = total size of the file/ input split size

      For example, if the total size of input is 1 GB and input split size is set to 128 MB then:
      No. of mappers = 1 x 1024 / 128 = 8 mappers.

      In you case, No. of Mappers = 400/128 => 4

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