// cross the wire during copy. B's data could potentially cross the wire.
Frame frbind = H2OHelper.emptyFrame(fra.numRows() + frb.numRows(), fra.numCols(),
-1, -1, fra.anyVec().group());
Vec keys = null;
MRTask task = new MRTask() {
public void map(Chunk chks[], NewChunk nc) {
Vec A_vecs[] = fra.vecs();
Vec B_vecs[] = frb.vecs();
long A_rows = fra.numRows();
long B_rows = frb.numRows();
long start = chks[0].start();
int chunkSize = chks[0].len();
ValueString vstr = new ValueString();
for (int r = 0; r < chunkSize; r++) {
for (int c = 0; c < chks.length; c++) {
if (r + start < A_rows) {
chks[c].set0(r, A_vecs[c].at(r + start));
if (keysa != null) {
nc.addStr(keysa.atStr(vstr, r + start));
}
} else {
chks[c].set0(r, B_vecs[c].at(r + start - A_rows));
if (keysb != null) {
nc.addStr(keysb.atStr(vstr, r + start - A_rows));
}
}
}
}
}
};
if (keysa == null) {
keys = task.doAll(1, frbind).outputFrame(null, null).anyVec();
} else {
task.doAll(frbind);
}
return new H2ODrm(frbind, keys);
}