Package io.druid.query.aggregation

Examples of io.druid.query.aggregation.CountAggregatorFactory


  @Test
  public void testSingleValueTopN()
  {
    IncrementalIndex index = new IncrementalIndex(
        0, QueryGranularity.MINUTE, new AggregatorFactory[]{new CountAggregatorFactory("cnt")},
        TestQueryRunners.pool
    );

    DateTime t = DateTime.now();
    index.add(
View Full Code Here


  @Test
  public void testFilterByNull() throws Exception
  {
    IncrementalIndex index = new IncrementalIndex(
         0, QueryGranularity.MINUTE, new AggregatorFactory[]{new CountAggregatorFactory("cnt")},
         TestQueryRunners.pool
     );

    index.add(
        new MapBasedInputRow(
View Full Code Here

  public void testSwap() throws Exception
  {
    final DataSchema schema = new DataSchema(
        "test",
        null,
        new AggregatorFactory[]{new CountAggregatorFactory("rows")},
        new UniformGranularitySpec(Granularity.HOUR, QueryGranularity.MINUTE, null, Granularity.HOUR)
    );

    final Interval interval = new Interval("2013-01-01/2013-01-02");
    final String version = new DateTime().toString();
View Full Code Here

    );

    schema = new DataSchema(
        "test",
        null,
        new AggregatorFactory[]{new CountAggregatorFactory("rows")},
        new UniformGranularitySpec(Granularity.HOUR, QueryGranularity.NONE, null, Granularity.HOUR)
    );
    RealtimeIOConfig ioConfig = new RealtimeIOConfig(
        new FirehoseFactory()
        {
View Full Code Here

          public InputRowParser withParseSpec(ParseSpec parseSpec)
          {
            return null;
          }
        },
        new AggregatorFactory[]{new CountAggregatorFactory("rows")},
        new UniformGranularitySpec(Granularity.HOUR, QueryGranularity.NONE, null, Granularity.HOUR)
    );

    announcer = EasyMock.createMock(DataSegmentAnnouncer.class);
    announcer.announceSegment(EasyMock.<DataSegment>anyObject());
View Full Code Here

                                        .dimension("bigdim")
                                        .metric("count")
                                        .threshold(1)
                                        .aggregators(
                                            ImmutableList.<AggregatorFactory>of(
                                                new CountAggregatorFactory("count")
                                            )
                                        );

    Assert.assertEquals(
        Optional.absent(),
        jsStrategy.getBrokerServiceName(
            tieredBrokerConfig,
            queryBuilder.build()
        )
    );


    Assert.assertEquals(
        Optional.absent(),
        jsStrategy.getBrokerServiceName(
            tieredBrokerConfig,
            Druids.newTimeBoundaryQueryBuilder().dataSource("test").bound("maxTime").build()
        )
    );

    Assert.assertEquals(
        Optional.of("druid/slowBroker"),
        jsStrategy.getBrokerServiceName(
            tieredBrokerConfig,
            queryBuilder.aggregators(
                ImmutableList.of(
                    new CountAggregatorFactory("count"),
                    new LongSumAggregatorFactory("longSum", "a"),
                    new DoubleSumAggregatorFactory("doubleSum", "b")
                )
            ).build()
        )
    );

    // in absence of tiers, expect the default
    tierBrokerMap.clear();
    Assert.assertEquals(
        Optional.of("druid/broker"),
        jsStrategy.getBrokerServiceName(
            tieredBrokerConfig,
            queryBuilder.aggregators(
                ImmutableList.of(
                    new CountAggregatorFactory("count"),
                    new LongSumAggregatorFactory("longSum", "a"),
                    new DoubleSumAggregatorFactory("doubleSum", "b")
                )
            ).build()
        )
View Full Code Here

  {
    String brokerName = (String) brokerSelector.select(
        Druids.newTimeseriesQueryBuilder()
              .dataSource("test")
              .granularity("all")
              .aggregators(Arrays.<AggregatorFactory>asList(new CountAggregatorFactory("rows")))
              .intervals(Arrays.<Interval>asList(new Interval("2011-08-31/2011-09-01")))
              .build()
    ).lhs;

    Assert.assertEquals("coldBroker", brokerName);
View Full Code Here

  {
    String brokerName = (String) brokerSelector.select(
        Druids.newTimeseriesQueryBuilder()
              .dataSource("test")
              .granularity("all")
              .aggregators(Arrays.<AggregatorFactory>asList(new CountAggregatorFactory("rows")))
              .intervals(Arrays.<Interval>asList(new Interval("2013-08-31/2013-09-01")))
              .build()
    ).lhs;

    Assert.assertEquals("hotBroker", brokerName);
View Full Code Here

  {
    String brokerName = (String) brokerSelector.select(
        Druids.newTimeseriesQueryBuilder()
              .dataSource("test")
              .granularity("all")
              .aggregators(Arrays.<AggregatorFactory>asList(new CountAggregatorFactory("rows")))
              .intervals(Arrays.<Interval>asList(new Interval("2010-08-31/2010-09-01")))
              .build()
    ).lhs;

    Assert.assertEquals("hotBroker", brokerName);
View Full Code Here

  public void testSelectMultiInterval() throws Exception
  {
    String brokerName = (String) brokerSelector.select(
        Druids.newTimeseriesQueryBuilder()
              .dataSource("test")
              .aggregators(Arrays.<AggregatorFactory>asList(new CountAggregatorFactory("count")))
              .intervals(
                  new MultipleIntervalSegmentSpec(
                      Arrays.<Interval>asList(
                          new Interval("2013-08-31/2013-09-01"),
                          new Interval("2012-08-31/2012-09-01"),
View Full Code Here

TOP

Related Classes of io.druid.query.aggregation.CountAggregatorFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.