Ported RowIterator and DistinctValueIterator.