Frame A = drmA.frame;
Vec keys = drmA.keys;
// Run a filtering MRTask on A. If row number falls within R.start() and
// R.end(), then the row makes it into the output
Frame Arr = new MRTask() {
public void map(Chunk chks[], NewChunk ncs[]) {
int chunkSize = chks[0].len();
long chunkStart = chks[0].start();
// First check if the entire chunk even overlaps with R
if (chunkStart > R.end() || (chunkStart + chunkSize) < R.start()) {
return;
}
// This chunk overlaps, filter out just the overlapping rows
for (int r = 0; r < chunkSize; r++) {
if (!R.contains(chunkStart + r)) {
continue;
}
for (int c = 0; c < chks.length; c++) {
ncs[c].addNum(chks[c].at0(r));
}
}
}
}.doAll(A.numCols(), A).outputFrame(null, null);
Vec Vrr = (keys == null) ? null : new MRTask() {
// This is a String keyed DRM. Do the same thing as above,
// but this time just one column of Strings.
public void map(Chunk chk, NewChunk nc) {
int chunkSize = chk.len();
long chunkStart = chk.start();