// the input
long firstUid=-1;
Map<Integer,Long> generatedInputUids = cg.getGeneratedInputUids();
for( Map.Entry<Integer, Long> entry : generatedInputUids.entrySet() ) {
Long uid = entry.getValue();
LogicalRelationalOperator pred =
(LogicalRelationalOperator) cg.getPlan().getPredecessors(cg).get(entry.getKey());
if( output.contains(uid) ) {
// Hence we need to all the full schema of the bag
input.addAll( getAllUids( pred.getSchema() ) );
}
if (pred.getSchema()!=null)
firstUid = pred.getSchema().getField(0).uid;
}
if (input.isEmpty() && firstUid!=-1) {
input.add(firstUid);
}