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(cType.table().getGroup());
plan = API.filter_Default(plan, Arrays.asList(cType, oType, iType));
plan = API.flatten_HKeyOrdered(plan, cType, oType, JoinType.LEFT_JOIN);
plan = API.flatten_HKeyOrdered(plan, plan.rowType(), iType, JoinType.LEFT_JOIN);
plan = API.project_Default(plan, expList, plan.rowType());
plan = API.sort_General(plan, plan.rowType(), ordering, SortOption.PRESERVE_DUPLICATES);
return plan;
}
});
}