Then you read the documentation, found your reasonable expectation to be wrong, found the rationale behind violating the expectation acceptable, read the many examples that illustrate how this expectation is always wrong for rmr2 and finally solved your problem. Really, not a single example that reads one row at a time in the mapper. If you had read one of them, you'd know exactly how things work. If you had traced a mapper once, you'd know. Row at a time is a hyper-inefficient programming style in R. You can't do big data that way. You can't even do medium data. It works only if every row is big in and of itself, like a matrix. Now you just have to write
stringdist(A[i:j,], B[i,])
for some i<j and you have to write it efficiently (loop over the rows of A and you go back to square one. It's call vectorization in R (a misnomer, but used consistently in R circles). You either learn it or no hadoop will rescue your programs. If you just want to pretend R is java with more statistical function, you are not going to be successful.