use of org.apache.druid.query.timeseries.TimeseriesQueryQueryToolChest in project druid by druid-io.
the class ArrayOfDoublesSketchTTestPostAggregatorTest method testResultArraySignature.
@Test
public void testResultArraySignature() {
final TimeseriesQuery query = Druids.newTimeseriesQueryBuilder().dataSource("dummy").intervals("2000/3000").granularity(Granularities.HOUR).aggregators(new CountAggregatorFactory("count")).postAggregators(new ArrayOfDoublesSketchTTestPostAggregator("a", ImmutableList.of(new ConstantPostAggregator("", 0), new ConstantPostAggregator("", 0)))).build();
Assert.assertEquals(RowSignature.builder().addTimeColumn().add("count", ColumnType.LONG).add("a", ColumnType.DOUBLE_ARRAY).build(), new TimeseriesQueryQueryToolChest().resultArraySignature(query));
}
use of org.apache.druid.query.timeseries.TimeseriesQueryQueryToolChest in project druid by druid-io.
the class ArrayOfDoublesSketchToEstimatePostAggregatorTest method testResultArraySignature.
@Test
public void testResultArraySignature() {
final TimeseriesQuery query = Druids.newTimeseriesQueryBuilder().dataSource("dummy").intervals("2000/3000").granularity(Granularities.HOUR).aggregators(new CountAggregatorFactory("count")).postAggregators(new ArrayOfDoublesSketchToEstimatePostAggregator("a", new ConstantPostAggregator("", 0))).build();
Assert.assertEquals(RowSignature.builder().addTimeColumn().add("count", ColumnType.LONG).add("a", ColumnType.DOUBLE).build(), new TimeseriesQueryQueryToolChest().resultArraySignature(query));
}
use of org.apache.druid.query.timeseries.TimeseriesQueryQueryToolChest in project druid by druid-io.
the class ArrayOfDoublesSketchToQuantilesSketchPostAggregatorTest method testResultArraySignature.
@Test
public void testResultArraySignature() {
final TimeseriesQuery query = Druids.newTimeseriesQueryBuilder().dataSource("dummy").intervals("2000/3000").granularity(Granularities.HOUR).aggregators(new CountAggregatorFactory("count")).postAggregators(new ArrayOfDoublesSketchToQuantilesSketchPostAggregator("a", new ConstantPostAggregator("", 0), 2, null)).build();
Assert.assertEquals(RowSignature.builder().addTimeColumn().add("count", ColumnType.LONG).add("a", ArrayOfDoublesSketchModule.MERGE_TYPE).build(), new TimeseriesQueryQueryToolChest().resultArraySignature(query));
}
use of org.apache.druid.query.timeseries.TimeseriesQueryQueryToolChest in project druid by druid-io.
the class ArrayOfDoublesSketchToStringPostAggregatorTest method testResultArraySignature.
@Test
public void testResultArraySignature() {
final TimeseriesQuery query = Druids.newTimeseriesQueryBuilder().dataSource("dummy").intervals("2000/3000").granularity(Granularities.HOUR).aggregators(new CountAggregatorFactory("count")).postAggregators(new ArrayOfDoublesSketchToStringPostAggregator("a", new ConstantPostAggregator("", 1))).build();
Assert.assertEquals(RowSignature.builder().addTimeColumn().add("count", ColumnType.LONG).add("a", ColumnType.STRING).build(), new TimeseriesQueryQueryToolChest().resultArraySignature(query));
}
use of org.apache.druid.query.timeseries.TimeseriesQueryQueryToolChest in project druid by druid-io.
the class BloomFilterAggregatorFactoryTest method testResultArraySignature.
@Test
public void testResultArraySignature() {
final TimeseriesQuery query = Druids.newTimeseriesQueryBuilder().dataSource("dummy").intervals("2000/3000").granularity(Granularities.HOUR).aggregators(new CountAggregatorFactory("count"), new BloomFilterAggregatorFactory("bloom", DefaultDimensionSpec.of("col"), 1024), new BloomFilterMergeAggregatorFactory("bloomMerge", "bloom", 1024)).postAggregators(new FieldAccessPostAggregator("bloom-access", "bloom"), new FinalizingFieldAccessPostAggregator("bloom-finalize", "bloom"), new FieldAccessPostAggregator("bloomMerge-access", "bloomMerge"), new FinalizingFieldAccessPostAggregator("bloomMerge-finalize", "bloomMerge")).build();
Assert.assertEquals(RowSignature.builder().addTimeColumn().add("count", ColumnType.LONG).add("bloom", BloomFilterAggregatorFactory.TYPE).add("bloomMerge", BloomFilterAggregatorFactory.TYPE).add("bloom-access", BloomFilterAggregatorFactory.TYPE).add("bloom-finalize", BloomFilterAggregatorFactory.TYPE).add("bloomMerge-access", BloomFilterAggregatorFactory.TYPE).add("bloomMerge-finalize", BloomFilterAggregatorFactory.TYPE).build(), new TimeseriesQueryQueryToolChest().resultArraySignature(query));
}
Aggregations