Search in sources :

Example 6 with StringFirstAggregatorFactory

use of org.apache.druid.query.aggregation.first.StringFirstAggregatorFactory in project druid by druid-io.

the class FinalizingFieldAccessPostAggregatorTest method testResultArraySignature.

@Test
public void testResultArraySignature() {
    final TimeseriesQuery query = Druids.newTimeseriesQueryBuilder().dataSource("dummy").intervals("2000/3000").granularity(Granularities.HOUR).aggregators(new CountAggregatorFactory("count"), new StringFirstAggregatorFactory("stringo", "col", null, 1024)).postAggregators(new FieldAccessPostAggregator("a", "stringo"), new FinalizingFieldAccessPostAggregator("b", "stringo")).build();
    Assert.assertEquals(RowSignature.builder().addTimeColumn().add("count", ColumnType.LONG).add("stringo", null).add("a", StringFirstAggregatorFactory.TYPE).add("b", ColumnType.STRING).build(), new TimeseriesQueryQueryToolChest().resultArraySignature(query));
}
Also used : TimeseriesQuery(org.apache.druid.query.timeseries.TimeseriesQuery) CountAggregatorFactory(org.apache.druid.query.aggregation.CountAggregatorFactory) StringFirstAggregatorFactory(org.apache.druid.query.aggregation.first.StringFirstAggregatorFactory) TimeseriesQueryQueryToolChest(org.apache.druid.query.timeseries.TimeseriesQueryQueryToolChest) GroupByQueryRunnerTest(org.apache.druid.query.groupby.GroupByQueryRunnerTest) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test)

Aggregations

StringFirstAggregatorFactory (org.apache.druid.query.aggregation.first.StringFirstAggregatorFactory)6 Test (org.junit.Test)6 LongLastAggregatorFactory (org.apache.druid.query.aggregation.last.LongLastAggregatorFactory)4 LongAnyAggregatorFactory (org.apache.druid.query.aggregation.any.LongAnyAggregatorFactory)3 StringAnyAggregatorFactory (org.apache.druid.query.aggregation.any.StringAnyAggregatorFactory)3 LongFirstAggregatorFactory (org.apache.druid.query.aggregation.first.LongFirstAggregatorFactory)3 StringLastAggregatorFactory (org.apache.druid.query.aggregation.last.StringLastAggregatorFactory)3 ExpressionLambdaAggregatorFactory (org.apache.druid.query.aggregation.ExpressionLambdaAggregatorFactory)2 FilteredAggregatorFactory (org.apache.druid.query.aggregation.FilteredAggregatorFactory)2 DoubleLastAggregatorFactory (org.apache.druid.query.aggregation.last.DoubleLastAggregatorFactory)2 FloatLastAggregatorFactory (org.apache.druid.query.aggregation.last.FloatLastAggregatorFactory)2 FinalizingFieldAccessPostAggregator (org.apache.druid.query.aggregation.post.FinalizingFieldAccessPostAggregator)2 DefaultDimensionSpec (org.apache.druid.query.dimension.DefaultDimensionSpec)2 SelectorDimFilter (org.apache.druid.query.filter.SelectorDimFilter)2 TimeseriesQuery (org.apache.druid.query.timeseries.TimeseriesQuery)2 TimeseriesQueryQueryToolChest (org.apache.druid.query.timeseries.TimeseriesQueryQueryToolChest)2 InitializedNullHandlingTest (org.apache.druid.testing.InitializedNullHandlingTest)2 JavaScriptConfig (org.apache.druid.js.JavaScriptConfig)1 CountAggregatorFactory (org.apache.druid.query.aggregation.CountAggregatorFactory)1 DoubleSumAggregatorFactory (org.apache.druid.query.aggregation.DoubleSumAggregatorFactory)1