use of io.trino.sql.planner.plan.AggregationNode.Step.FINAL in project trino by trinodb.
the class TestValidateAggregationsWithDefaultValues method testWithPartialAggregationBelowJoin.
@Test
public void testWithPartialAggregationBelowJoin() {
Symbol symbol = new Symbol("symbol");
PlanNode root = builder.aggregation(af -> af.step(FINAL).groupingSets(groupingSets(ImmutableList.of(symbol), 2, ImmutableSet.of(0))).source(builder.join(INNER, builder.exchange(e -> e.type(REPARTITION).scope(LOCAL).fixedHashDistributionParitioningScheme(ImmutableList.of(symbol), ImmutableList.of(symbol)).addInputsSet(symbol).addSource(builder.aggregation(ap -> ap.step(PARTIAL).groupingSets(groupingSets(ImmutableList.of(symbol), 2, ImmutableSet.of(0))).source(tableScanNode)))), builder.values())));
validatePlan(root, true);
}
use of io.trino.sql.planner.plan.AggregationNode.Step.FINAL in project trino by trinodb.
the class TestValidateAggregationsWithDefaultValues method testWithPartialAggregationBelowJoinWithoutSeparatingExchange.
@Test
public void testWithPartialAggregationBelowJoinWithoutSeparatingExchange() {
Symbol symbol = new Symbol("symbol");
PlanNode root = builder.aggregation(af -> af.step(FINAL).groupingSets(groupingSets(ImmutableList.of(symbol), 2, ImmutableSet.of(0))).source(builder.join(INNER, builder.aggregation(ap -> ap.step(PARTIAL).groupingSets(groupingSets(ImmutableList.of(symbol), 2, ImmutableSet.of(0))).source(tableScanNode)), builder.values())));
assertThatThrownBy(() -> validatePlan(root, true)).isInstanceOf(IllegalArgumentException.class).hasMessage("Final aggregation with default value not separated from partial aggregation by local hash exchange");
}
Aggregations