Examples of CountAggregator


Examples of com.salesforce.phoenix.expression.aggregator.CountAggregator

        };
    }
   
    @Override
    public Aggregator newServerAggregator(Configuration conf) {
        return new CountAggregator();
    }
View Full Code Here

Examples of com.salesforce.phoenix.expression.aggregator.CountAggregator

    @Override
    public Aggregator newServerAggregator(Configuration config, ImmutableBytesWritable ptr) {
        LongSumAggregator sumAgg = newClientAggregator();
        sumAgg.aggregate(null, ptr);
        return new CountAggregator(sumAgg);
    }
View Full Code Here

Examples of io.druid.query.aggregation.CountAggregator

{
  @Test
  public void testCompute()
  {
    ArithmeticPostAggregator arithmeticPostAggregator;
    CountAggregator agg = new CountAggregator("rows");
    agg.aggregate();
    agg.aggregate();
    agg.aggregate();
    Map<String, Object> metricValues = new HashMap<String, Object>();
    metricValues.put(agg.getName(), agg.get());

    List<PostAggregator> postAggregatorList =
        Lists.newArrayList(
            new ConstantPostAggregator(
                "roku", 6, null
View Full Code Here

Examples of io.druid.query.aggregation.CountAggregator

  @Test
  public void testComparator()
  {
    ArithmeticPostAggregator arithmeticPostAggregator;
    CountAggregator agg = new CountAggregator("rows");
    Map<String, Object> metricValues = new HashMap<String, Object>();
    metricValues.put(agg.getName(), agg.get());

    List<PostAggregator> postAggregatorList =
        Lists.newArrayList(
            new ConstantPostAggregator(
                "roku", 6, null
            ),
            new FieldAccessPostAggregator(
                "rows", "rows"
            )
        );

    arithmeticPostAggregator = new ArithmeticPostAggregator("add", "+", postAggregatorList);
    Comparator comp = arithmeticPostAggregator.getComparator();
    Object before = arithmeticPostAggregator.compute(metricValues);
    agg.aggregate();
    agg.aggregate();
    agg.aggregate();
    metricValues.put(agg.getName(), agg.get());
    Object after = arithmeticPostAggregator.compute(metricValues);

    Assert.assertEquals(-1, comp.compare(before, after));
    Assert.assertEquals(0, comp.compare(before, before));
    Assert.assertEquals(0, comp.compare(after, after));
View Full Code Here

Examples of io.druid.query.aggregation.CountAggregator

  public void testCompute()
  {
    FieldAccessPostAggregator fieldAccessPostAggregator;

    fieldAccessPostAggregator = new FieldAccessPostAggregator("To be, or not to be, that is the question:", "rows");
    CountAggregator agg = new CountAggregator("rows");
    Map<String, Object> metricValues = new HashMap<String, Object>();
    metricValues.put(agg.getName(), agg.get());
    Assert.assertEquals(new Long(0L), fieldAccessPostAggregator.compute(metricValues));

    agg.aggregate();
    agg.aggregate();
    agg.aggregate();
    metricValues.put(agg.getName(), agg.get());
    Assert.assertEquals(new Long(3L), fieldAccessPostAggregator.compute(metricValues));
  }
View Full Code Here

Examples of io.druid.query.aggregation.CountAggregator

    );

    TimeseriesResultBuilder builder = new TimeseriesResultBuilder(
        new DateTime("2012-01-01T00:00:00Z")
    );
    CountAggregator rows = new CountAggregator("rows");
    rows.aggregate();
    builder.addMetric(rows);
    final Result<TimeseriesResultValue> value = builder.build();

    final SpecificSegmentQueryRunner queryRunner = new SpecificSegmentQueryRunner(
        new QueryRunner()
View Full Code Here

Examples of org.apache.phoenix.expression.aggregator.CountAggregator

        };
    }
   
    @Override
    public Aggregator newServerAggregator(Configuration conf) {
        return new CountAggregator();
    }
View Full Code Here

Examples of org.apache.phoenix.expression.aggregator.CountAggregator

    @Override
    public Aggregator newServerAggregator(Configuration config, ImmutableBytesWritable ptr) {
        LongSumAggregator sumAgg = newClientAggregator();
        sumAgg.aggregate(null, ptr);
        return new CountAggregator(sumAgg);
    }
View Full Code Here

Examples of org.yaac.server.egql.evaluator.aggregator.CountAggregator

  @Deprecated
  public Aggregator newAggregator() {   
    switch (this.type) {
    case COUNT:
      // COUNT will only count those records in which the field in the brackets is NOT NULL.
      return new CountAggregator();
    case MAX:
      return new MaxAggregator();
    case MIN:
      return new MinAggregator();
    case AVG:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.