use of org.apache.ignite.internal.sql.engine.rel.agg.IgniteSingleSortAggregate in project ignite-3 by apache.
the class SortAggregatePlannerTest method collationPermuteSingle.
/**
* CollationPermuteSingle.
* TODO Documentation https://issues.apache.org/jira/browse/IGNITE-15859
*
* @throws Exception If failed.
*/
@Test
public void collationPermuteSingle() 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.broadcast();
}
}.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");
IgniteSingleSortAggregate agg = findFirstNode(phys, byClass(IgniteSingleSortAggregate.class));
assertNotNull(agg, "Invalid plan\n" + RelOptUtil.toString(phys));
assertNull(findFirstNode(phys, byClass(IgniteSort.class)), "Invalid plan\n" + RelOptUtil.toString(phys));
}
Aggregations