how to transpose a 5x5 matrix using mapreduce -


i have tried mapper dividing matrix 2x2 , giving reducer. reducer perform transpose each 2x2 matrix. while dividing odd order matrix 2x2 leaving 1x1 matrix @ end. how write map , reduce function overcome problem. please send me solution.

assuming matrix in csv delimited columns , new line rows. can read line line in map task each line, split based on comma , token each column. need custom value object reducer(inherit writable), store line_number & value @ specific column.

the map task emit, key column number @ column value read , value custom value object defined above.

you need secondary sort/comparator sort based on custom value object's line_number filed when order can maintained when values iterated @ reducer end.

at reducer, read keys sorted based on line number, iterator each key , create csv string , write output file.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -