Find max sum matrix in a matrix

Find a kk matrix in mn matrix of integers with max sum(1. k is given. 2. k is not given). This matrix is huge and is represented as text file having (i, j, value) in each line. The matrix can’t be loaded into the memory but each row can fit in the memory. You can use spark or hadoop for solving this.