outputType = Types.overrideMode(inputType, DataMode.OPTIONAL);
} else {
outputType = inputType;
}
JVar vvIn = cg.declareVectorValueSetupAndMember("incomingLeft",
new TypedFieldId(inputType, vectorId));
JVar vvOut = cg.declareVectorValueSetupAndMember("outgoing",
new TypedFieldId(outputType,vectorId));
// todo: check result of copyFromSafe and grow allocation
cg.getEvalBlock()._if(vvOut.invoke("copyFromSafe")
.arg(copyLeftMapping.getValueReadIndex())
.arg(copyLeftMapping.getValueWriteIndex())
.arg(vvIn).eq(JExpr.FALSE))
._then()
._return(JExpr.FALSE);
++vectorId;
}
}
cg.getEvalBlock()._return(JExpr.lit(true));
// generate copyRight()
///////////////////////
cg.setMappingSet(copyRightMappping);
int rightVectorBase = vectorId;
if (worker == null || status.isRightPositionAllowed()) {
for (VectorWrapper<?> vw : right) {
MajorType inputType = vw.getField().getType();
MajorType outputType;
if (joinType == JoinRelType.LEFT && inputType.getMode() == DataMode.REQUIRED) {
outputType = Types.overrideMode(inputType, DataMode.OPTIONAL);
} else {
outputType = inputType;
}
JVar vvIn = cg.declareVectorValueSetupAndMember("incomingRight",
new TypedFieldId(inputType, vectorId - rightVectorBase));
JVar vvOut = cg.declareVectorValueSetupAndMember("outgoing",
new TypedFieldId(outputType,vectorId));
// todo: check result of copyFromSafe and grow allocation
cg.getEvalBlock()._if(vvOut.invoke("copyFromSafe")
.arg(copyRightMappping.getValueReadIndex())
.arg(copyRightMappping.getValueWriteIndex())
.arg(vvIn).eq(JExpr.FALSE))