Tuple aRow = valuesFromLastDataset.next();
this.rememberTuple(_lastDatasetID, aRow, reporter);
}
Iterable<Tuple> preCrossProduct = Util.crossProduct(conf, reporter, this.valuesForAllDatasets.values().toArray(new BigTupleList[0]));
BigTupleList btl = new BigTupleList(reporter);
for( Tuple aRow:preCrossProduct )
{
this.computeExtendFunctions(aRow, btl, this.multiDatasetExtendFunction);
this.computeGroupFunctions(aRow, this.multiDatasetGroupFunction);
}
if( btl.size()>0 )
toBeCrossProduct.add(btl);
for(GroupFunction fun:this.multiDatasetGroupFunction )
toBeCrossProduct.add(fun.getResult());
valuesFromLastDataset = this.valuesForAllDatasets.get(_lastDatasetID).iterator();
}
else
{
if( this.multiDatasetExtendFunction.size()>0 )
{
BigTupleList btl = new BigTupleList(reporter);
this.computeExtendFunctions(null, btl, this.multiDatasetExtendFunction);
toBeCrossProduct.add(btl);
}
for(GroupFunction fun:this.multiDatasetGroupFunction )
toBeCrossProduct.add(fun.getNoMatchResult(nullReplacement));
}
}
// finished the computation of multi-dataset functions, start
// to compute the projectable funcitons results for last
// dataset
//
// first compute the cross product of all other functions
Iterable<Tuple> others = null;
if( toBeCrossProduct.size()>0 )
{
Iterable<Tuple>[] array = new Iterable[toBeCrossProduct.size()];
for( int i=0;i<toBeCrossProduct.size();i++ )
{
array[i] = toBeCrossProduct.get(i);
}
others = Util.crossProduct(conf, reporter, array);
}
if( valuesFromLastDataset==null )
{// outer-join, so <code>others</code> is always not null.
List<BigTupleList> nullResult = new ArrayList<BigTupleList>();
if( this.singleDatasetExtendFunction.get(_lastDatasetID)!=null )
{
BigTupleList btl = new BigTupleList(reporter);
this.computeExtendFunctions(null, btl, this.singleDatasetExtendFunction.get(_lastDatasetID));
nullResult.add(btl);
}
if( this.singleDatasetGroupFunction.get(_lastDatasetID)!=null )
{