protected List<Row> getOtherExpected() {
// Generate what should be in the table index from the group rows
return runPlanTxn(new OperatorCreator() {
@Override
public Operator create(Schema schema) {
RowType tType = schema.tableRowType(tID);
List<ExpressionGenerator> expList = Arrays.asList(
ExpressionGenerators.field(tableRowType, 0, 1), // x
ExpressionGenerators.field(tableRowType, 1, 0) // id
);
Ordering ordering = API.ordering();
for(int i = 0; i < expList.size(); ++i) {
TPreparedExpression prep = expList.get(i).getTPreparedExpression();
ordering.append(ExpressionGenerators.field(prep.resultType(), i), true);
}
Operator plan = API.groupScan_Default(tType.table().getGroup());
plan = API.project_Default(plan, expList, tType);
plan = API.sort_General(plan, plan.rowType(), ordering, SortOption.PRESERVE_DUPLICATES);
return plan;
}
});