int dummy = 0;
for (int c = 2; c <= semiJoinResult1.getCardinality(); c++) {
indexesWithoutThefirst1[dummy++] = c;
}
AggregationOperator agregOper1 = new AggregationOperator(caf, semiJoinResult1, new int[]{1}, new CountExtender(caf, new int[][]{indexesWithoutThefirst1}));
formulas.putAll(agregOper1.getFormulas());
Relation groupBy1 = agregOper1.getResultRelation();
dummyRelation = extend(dummyRelation, agregOper1.getDummyRelation());
dummyRelation = extend(dummyRelation, groupBy1);
labels.putAll(agregOper1.getLabels());
//select (C,count(D)) from (C,D) group by D for the second relation
int[] indexesWithoutTheFirst2 = new int[semiJoinResult2.getCardinality() - 1];
dummy = 0;
for (int c = 2; c <= semiJoinResult2.getCardinality(); c++) {
indexesWithoutTheFirst2[dummy++] = c;
}
AggregationOperator agregOper2 = new AggregationOperator(caf, semiJoinResult2, new int[]{1}, new CountExtender(caf, new int[][]{indexesWithoutTheFirst2}));
formulas.putAll(agregOper2.getFormulas());
Relation groupBy2 = agregOper2.getResultRelation();
dummyRelation = extend(dummyRelation, agregOper2.getDummyRelation());
dummyRelation = extend(dummyRelation, groupBy2);
labels.putAll(agregOper2.getLabels());