LogicalInput logicalInput = Util.getFirst( logicalInputs.getValues() );
KeyValuesReader reader = (KeyValuesReader) logicalInput.getReader();
if( sortFields != null )
reader = new SecondarySortKeyValuesReader( reader, groupComparators[ 0 ] );
while( reader.next() )
{
Tuple currentKey = (Tuple) reader.getCurrentKey(); // if secondary sorting, is a TuplePair
Iterable currentValues = reader.getCurrentValues();