if(processingPlan){
while(true) {
res = processPlan();
if(res.returnStatus==POStatus.STATUS_OK) {
if(lineageTracer != null && res.result != null) {
ExampleTuple tOut = new ExampleTuple((Tuple) res.result);
tOut.synthetic = tIn.synthetic;
lineageTracer.insert(tOut);
lineageTracer.union(tOut, tIn);
res.result = tOut;
}
return res;
}
if(res.returnStatus==POStatus.STATUS_EOP) {
processingPlan = false;
for(PhysicalPlan plan : inputPlans)
plan.detachInput();
return res;
}
if(res.returnStatus==POStatus.STATUS_ERR) {
return res;
}
if(res.returnStatus==POStatus.STATUS_NULL) {
continue;
}
}
}
//The nested plan processing is done or is
//yet to begin. So process the input and start
//nested plan processing on the input tuple
//read
while (true) {
// we know that input has been attached
attachInputToPlans(input);
detachInput();
res = processPlan();
processingPlan = true;
if(lineageTracer != null && res.result != null) {
//we check for res.result since that can also be null in the case of flatten
tIn = (ExampleTuple) input;
ExampleTuple tOut = new ExampleTuple((Tuple) res.result);
tOut.synthetic = tIn.synthetic;
lineageTracer.insert(tOut);
lineageTracer.union(tOut, tIn);
res.result = tOut;
}