assertEquals("input = expected size", input.size(), expected.size());
RowsBuilder inputRows = createBuilder(input);
Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
StoreAdapter adapter = newStoreAdapter(schema);
TestOperator inputOperator = new TestOperator(inputRows);
QueryContext context = queryContext(adapter);
QueryBindings bindings = context.createBindings();
Cursor inputCursor = API.cursor(inputOperator, context, bindings);
inputCursor.openTopLevel();
API.Ordering ordering = API.ordering();
for(int i = 0; i < fieldOrdering.length; ++i) {
ordering.append(field(inputOperator.rowType(), i), fieldOrdering[i]);
}
Sorter sorter = createSorter(context, bindings, inputCursor, inputOperator.rowType(), ordering, sortOption, TEST_TAP);
RowCursor sortedCursor = sorter.sort();
Row[] expectedRows = createBuilder(expected).rows().toArray(new Row[expected.size()]);
compareRows(expectedRows, sortedCursor);
}