Write a Map Reduce program to find max of 2 consecutive columns

Our HadoopTpoint App is now available in google play store,please rate and comment it in play store : W3Schools

Write a Map Reduce program to find max of 2 consecutive rows

Suppose you have 1TB flat file and that file hiving billions of lines integer type data with “,” delimited,Here is we have to find out max number of 2 consecutive rows in 1 TB file.

sample file data:
————————
1,5,8,9,7,4,4,5,8,9
4,3,7,4,5,8,4,5,5,4
.
.
.
.
.
.
.
.
.
7,2,8,8,9,8,9,5,6,4
————————
For Ex:
1st column values 1,4,…..,7 and 2nd row values 5,3,……,2
Now entire 1st & 2nd row MAX value is : 7
Write a Map Reduce program to find max of 2 consecutive columns?
Output like:
================
1st&2ndRow 8
2nd&3rdRow 8
.
.
.
.
9th&10thRow 6
Driver Code
Mapper Code 
Our Output will Come Like this
Output like:
================
1st&2ndRow 7
2nd&3rdRow 8
.
.
.
.
9th&10thRow 6

Comments

  1. prathap balachandra says:

    @ Mahesh.. Nice work.. But expecting little more advanced programs involving custom datatypes, custom record reader.

    Best,
    Prathap

  2. how to run this program pls rply soon

    Map Reduce program to find max of 2 consecutive columns

  3. mahesh chimmiri says:

    Create the Jar file for Driver class

    use the execution command

    hadoop jar jarname ur input path ur output path

    • Hi Mahes,

      I would like to thank you for contribution to all with your knowledge. I ran your program and observed that logic for finding greater number in consecutive columns is wrong. when you comparing 2 sorted arrays, then why should using below condition.

      if(values[i]==values1[j-1]){
      compvalue = values[i];
      }

      more over this logic seems greatest values in 2 consecutive rows not columns. Can you please verify your logic and correct me if I am wrong.

Speak Your Mind

*