List<?> lastTuple = null;
boolean sortedDistinct = sorted && !state.isDistinct();
int sizeHint = index.getExpectedHeight(state.getTupleBuffer().getRowCount());
outer: while (its.hasNext()) {
//detect if sorted and distinct
List<?> originalTuple = its.nextTuple();
//remove the tuple if it has null
for (int i : state.getExpressionIndexes()) {
if (originalTuple.get(i) == null) {
continue outer;
}