use of org.apache.ignite.internal.sql.engine.rel.agg.IgniteReduceSortAggregate in project ignite-3 by apache.
the class SortAggregatePlannerTest method collationPermuteMapReduce.
/**
* CollationPermuteMapReduce.
* TODO Documentation https://issues.apache.org/jira/browse/IGNITE-15859
*
* @throws Exception If failed.
*/
@Test
public void collationPermuteMapReduce() throws Exception {
IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);
TestTable tbl = new TestTable(new RelDataTypeFactory.Builder(f).add("ID", f.createJavaType(Integer.class)).add("VAL0", f.createJavaType(Integer.class)).add("VAL1", f.createJavaType(Integer.class)).add("GRP0", f.createJavaType(Integer.class)).add("GRP1", f.createJavaType(Integer.class)).build()) {
@Override
public IgniteDistribution distribution() {
return IgniteDistributions.affinity(0, "test", "hash");
}
}.addIndex(RelCollations.of(ImmutableIntList.of(3, 4)), "grp0_1");
IgniteSchema publicSchema = new IgniteSchema("PUBLIC");
publicSchema.addTable("TEST", tbl);
String sql = "SELECT MIN(val0) FROM test GROUP BY grp1, grp0";
IgniteRel phys = physicalPlan(sql, publicSchema, "HashSingleAggregateConverterRule", "HashMapReduceAggregateConverterRule");
IgniteReduceSortAggregate agg = findFirstNode(phys, byClass(IgniteReduceSortAggregate.class));
assertNotNull(agg, "Invalid plan\n" + RelOptUtil.toString(phys));
assertNull(findFirstNode(phys, byClass(IgniteSort.class)), "Invalid plan\n" + RelOptUtil.toString(phys));
}
Aggregations