Search in sources :

Example 1 with DimensionSelectorHavingSpec

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();
}
Also used : OrderByColumnSpec(io.druid.query.groupby.orderby.OrderByColumnSpec) DefaultDimensionSpec(io.druid.query.dimension.DefaultDimensionSpec) RegexFilteredDimensionSpec(io.druid.query.dimension.RegexFilteredDimensionSpec) ExtractionDimensionSpec(io.druid.query.dimension.ExtractionDimensionSpec) ListFilteredDimensionSpec(io.druid.query.dimension.ListFilteredDimensionSpec) DimensionSpec(io.druid.query.dimension.DimensionSpec) OrHavingSpec(io.druid.query.groupby.having.OrHavingSpec) DefaultLimitSpec(io.druid.query.groupby.orderby.DefaultLimitSpec) GreaterThanHavingSpec(io.druid.query.groupby.having.GreaterThanHavingSpec) HavingSpec(io.druid.query.groupby.having.HavingSpec) DimFilterHavingSpec(io.druid.query.groupby.having.DimFilterHavingSpec) BaseHavingSpec(io.druid.query.groupby.having.BaseHavingSpec) OrHavingSpec(io.druid.query.groupby.having.OrHavingSpec) DimensionSelectorHavingSpec(io.druid.query.groupby.having.DimensionSelectorHavingSpec) EqualToHavingSpec(io.druid.query.groupby.having.EqualToHavingSpec) LongSumAggregatorFactory(io.druid.query.aggregation.LongSumAggregatorFactory) DimensionSelectorHavingSpec(io.druid.query.groupby.having.DimensionSelectorHavingSpec) DefaultDimensionSpec(io.druid.query.dimension.DefaultDimensionSpec) Test(org.junit.Test)

Aggregations

LongSumAggregatorFactory (io.druid.query.aggregation.LongSumAggregatorFactory)1 DefaultDimensionSpec (io.druid.query.dimension.DefaultDimensionSpec)1 DimensionSpec (io.druid.query.dimension.DimensionSpec)1 ExtractionDimensionSpec (io.druid.query.dimension.ExtractionDimensionSpec)1 ListFilteredDimensionSpec (io.druid.query.dimension.ListFilteredDimensionSpec)1 RegexFilteredDimensionSpec (io.druid.query.dimension.RegexFilteredDimensionSpec)1 BaseHavingSpec (io.druid.query.groupby.having.BaseHavingSpec)1 DimFilterHavingSpec (io.druid.query.groupby.having.DimFilterHavingSpec)1 DimensionSelectorHavingSpec (io.druid.query.groupby.having.DimensionSelectorHavingSpec)1 EqualToHavingSpec (io.druid.query.groupby.having.EqualToHavingSpec)1 GreaterThanHavingSpec (io.druid.query.groupby.having.GreaterThanHavingSpec)1 HavingSpec (io.druid.query.groupby.having.HavingSpec)1 OrHavingSpec (io.druid.query.groupby.having.OrHavingSpec)1 DefaultLimitSpec (io.druid.query.groupby.orderby.DefaultLimitSpec)1 OrderByColumnSpec (io.druid.query.groupby.orderby.OrderByColumnSpec)1 Test (org.junit.Test)1