use of com.facebook.presto.spi.plan.PlanNode in project presto by prestodb.
the class TestDynamicFiltersChecker method testUnconsumedDynamicFilterInJoin.
@Test(expectedExceptions = VerifyException.class, expectedExceptionsMessageRegExp = "Dynamic filters \\[DF\\] present in join were not fully consumed by its probe side," + " currentJoinDynamicFilters is: \\[DF\\], consumedProbeSide is: \\[\\]")
public void testUnconsumedDynamicFilterInJoin() {
PlanNode root = builder.join(INNER, builder.filter(builder.rowExpression("ORDERS_OK > 0"), ordersTableScanNode), lineitemTableScanNode, ImmutableList.of(new JoinNode.EquiJoinClause(ordersOrderKeyVariable, lineitemOrderKeyVariable)), ImmutableList.of(ordersOrderKeyVariable), Optional.empty(), Optional.empty(), Optional.empty(), ImmutableMap.of("DF", lineitemOrderKeyVariable));
validatePlan(root);
}
use of com.facebook.presto.spi.plan.PlanNode in project presto by prestodb.
the class TestDynamicFiltersChecker method testUnmatchedDynamicFilter.
@Test(expectedExceptions = VerifyException.class, expectedExceptionsMessageRegExp = "All consumed dynamic filters could not be matched with a join.")
public void testUnmatchedDynamicFilter() {
PlanNode root = builder.output(ImmutableList.of(), ImmutableList.of(), builder.join(INNER, ordersTableScanNode, builder.filter(logicalRowExpressions.combineConjuncts(builder.rowExpression("LINEITEM_OK > 0"), createDynamicFilterExpression("DF", lineitemOrderKeyVariable, metadata.getFunctionAndTypeManager())), lineitemTableScanNode), ImmutableList.of(new JoinNode.EquiJoinClause(ordersOrderKeyVariable, lineitemOrderKeyVariable)), ImmutableList.of(ordersOrderKeyVariable), Optional.empty(), Optional.empty(), Optional.empty(), ImmutableMap.of()));
validatePlan(root);
}
use of com.facebook.presto.spi.plan.PlanNode in project presto by prestodb.
the class TestValidateStreamingAggregations method validatePlan.
private void validatePlan(Function<PlanBuilder, PlanNode> planProvider) {
PlanBuilder builder = new PlanBuilder(TEST_SESSION, idAllocator, metadata);
PlanNode planNode = planProvider.apply(builder);
TypeProvider types = builder.getTypes();
getQueryRunner().inTransaction(session -> {
// metadata.getCatalogHandle() registers the catalog for the transaction
session.getCatalog().ifPresent(catalog -> metadata.getCatalogHandle(session, catalog));
new ValidateStreamingAggregations().validate(planNode, session, metadata, sqlParser, types, WarningCollector.NOOP);
return null;
});
}
use of com.facebook.presto.spi.plan.PlanNode in project presto by prestodb.
the class TestValidateAggregationsWithDefaultValues method testGloballyDistributedFinalAggregationInTheSameStageAsPartialAggregation.
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Final aggregation with default value not separated from partial aggregation by remote hash exchange")
public void testGloballyDistributedFinalAggregationInTheSameStageAsPartialAggregation() {
PlanNode root = builder.aggregation(af -> af.step(FINAL).groupingSets(groupingSets(ImmutableList.of(variable), 2, ImmutableSet.of(0))).source(builder.aggregation(ap -> ap.step(PARTIAL).groupingSets(groupingSets(ImmutableList.of(variable), 2, ImmutableSet.of(0))).source(tableScanNode))));
validatePlan(root, false);
}
use of com.facebook.presto.spi.plan.PlanNode in project presto by prestodb.
the class TestValidateAggregationsWithDefaultValues method testSingleThreadFinalAggregationInTheSameStageAsPartialAggregation.
@Test
public void testSingleThreadFinalAggregationInTheSameStageAsPartialAggregation() {
PlanNode root = builder.aggregation(af -> af.step(FINAL).groupingSets(groupingSets(ImmutableList.of(variable), 2, ImmutableSet.of(0))).source(builder.aggregation(ap -> ap.step(PARTIAL).groupingSets(groupingSets(ImmutableList.of(variable), 2, ImmutableSet.of(0))).source(builder.values()))));
validatePlan(root, true);
}
Aggregations