use of com.facebook.presto.spi.plan.AggregationNode in project presto by prestodb.
the class TestPinotQueryGeneratorSql method testDistinctSelection.
@Override
@Test
public void testDistinctSelection() {
PlanBuilder planBuilder = createPlanBuilder(defaultSessionHolder);
TableScanNode tableScanNode = tableScan(planBuilder, pinotTable, regionId, secondsSinceEpoch, city, fare);
AggregationNode aggregationNode = planBuilder.aggregation(aggBuilder -> aggBuilder.source(tableScanNode).singleGroupingSet(variable("regionid")));
testPinotQuery(pinotConfig, aggregationNode, "SELECT regionId FROM realtimeOnly GROUP BY regionId LIMIT 10000", defaultSessionHolder, ImmutableMap.of());
aggregationNode = planBuilder.aggregation(aggBuilder -> aggBuilder.source(tableScanNode).singleGroupingSet(variable("city"), variable("regionid")));
testPinotQuery(pinotConfig, aggregationNode, "SELECT city, regionId FROM realtimeOnly GROUP BY city, regionId LIMIT 10000", defaultSessionHolder, ImmutableMap.of());
}
Aggregations