use of com.facebook.presto.sql.planner.assertions.ExpectedValueProvider in project presto by prestodb.
the class TestPinotPlanOptimizer method testUnsupportedPredicatePushdown.
@Test
public void testUnsupportedPredicatePushdown() {
Map<String, ExpectedValueProvider<FunctionCall>> aggregationsSecond = ImmutableMap.of("count", PlanMatchPattern.functionCall("count", false, ImmutableList.of()));
PlanBuilder planBuilder = createPlanBuilder(defaultSessionHolder);
PlanNode limit = limit(planBuilder, 50L, tableScan(planBuilder, pinotTable, regionId, city, fare, secondsSinceEpoch));
PlanNode originalPlan = planBuilder.aggregation(builder -> builder.source(limit).globalGrouping().addAggregation(new VariableReferenceExpression(Optional.empty(), "count", BIGINT), getRowExpression("count(*)", defaultSessionHolder)));
PlanNode optimized = getOptimizedPlan(planBuilder, originalPlan);
PlanMatchPattern tableScanMatcher = PinotTableScanMatcher.match(pinotTable, Optional.of("SELECT regionId, city, fare, secondsSinceEpoch FROM hybrid LIMIT 50"), Optional.of(false), originalPlan.getOutputVariables(), useSqlSyntax());
assertPlanMatch(optimized, aggregation(aggregationsSecond, tableScanMatcher), typeProvider);
}
Aggregations