Vec keysa = drmA.keys;
Frame frb = drmB.frame;
Vec keysb = drmB.keys;
// If A and B are similarly partitioned, ..
if (fra.anyVec().group() == frb.anyVec().group()) {
// .. then, do a light weight zip()
return zip(fra, keysa, frb, keysb);
} else {
// .. else, do a heavy weight join() which involves moving data over the wire
return join(fra, keysa, frb, keysb);