use of io.druid.query.groupby.having.DimensionSelectorHavingSpec in project druid by druid-io.
the class GroupByQueryRunnerTest method testGroupByWithUnderUnderTimeAsDimensionNameWithHavingAndLimit.
@Test
public void testGroupByWithUnderUnderTimeAsDimensionNameWithHavingAndLimit() {
expectedException.expect(IAE.class);
expectedException.expectMessage("'__time' cannot be used as an output name for dimensions, aggregators, or post-aggregators.");
GroupByQuery query = GroupByQuery.builder().setDataSource(QueryRunnerTestHelper.dataSource).setQuerySegmentSpec(QueryRunnerTestHelper.firstToThird).setDimensions(Lists.<DimensionSpec>newArrayList(new DefaultDimensionSpec("quality", "__time"))).setAggregatorSpecs(Arrays.asList(QueryRunnerTestHelper.rowsCount, new LongSumAggregatorFactory("idx", "index"))).setGranularity(QueryRunnerTestHelper.dayGran).setHavingSpec(new OrHavingSpec(ImmutableList.<HavingSpec>of(new DimensionSelectorHavingSpec("__time", "automotive", null), new DimensionSelectorHavingSpec("__time", "business", null)))).setLimitSpec(new DefaultLimitSpec(ImmutableList.of(new OrderByColumnSpec("__time", OrderByColumnSpec.Direction.DESCENDING)), null)).build();
}
Aggregations