Examples of Aggregation


Examples of org.eigenbase.rel.Aggregation

      aggExprs.add(ne);

      if (getOperatorPhase() == OperatorPhase.PHASE_1of2) {
        if (aggCall.e.getAggregation().getName().equals("COUNT")) {
          // If we are doing a COUNT aggregate in Phase1of2, then in Phase2of2 we should SUM the COUNTs,
          Aggregation sumAggFun = new SqlSumCountAggFunction(aggCall.e.getType());
          AggregateCall newAggCall =
              new AggregateCall(
                  sumAggFun,
                  aggCall.e.isDistinct(),
                  Collections.singletonList(aggExprOrdinal),
View Full Code Here

Examples of org.elasticsearch.search.aggregations.Aggregation

        .subAggregation(AggregationBuilders.count("countActiveRules")))
      .setSize(0)
      .setTypes(this.getIndexType());
    SearchResponse response = request.get();
    Map<String, Multimap<String, FacetValue>> stats = new HashMap<String, Multimap<String, FacetValue>>();
    Aggregation aggregation = response.getAggregations().get(ActiveRuleNormalizer.ActiveRuleField.PROFILE_KEY.field());
    for (Terms.Bucket value : ((Terms) aggregation).getBuckets()) {
      stats.put(value.getKey()
        , this.processAggregations(value.getAggregations()));
    }
View Full Code Here

Examples of org.elasticsearch.search.aggregations.Aggregation

    public double resolveValue(HasAggregations root) {
        HasAggregations parent = root;
        double value = Double.NaN;
        for (int i = 0; i < tokens.length; i++) {
            OrderPath.Token token = tokens[i];
            Aggregation agg = parent.getAggregations().get(token.name);

            if (agg == null) {
                throw new ElasticsearchIllegalArgumentException("Invalid order path [" + this +
                        "]. Cannot find aggregation named [" + token.name + "]");
            }
View Full Code Here

Examples of org.radargun.reporting.commons.Aggregation

         // in fact we shouldn't have different iterations values for iterations with the same id,
         // but it's possible
         Set<String> iterationValues = new HashSet<>();
         for (List<Aggregation> aggregations : reportAggregationMap.values()) {
            if (aggregations != null && iteration < aggregations.size()) {
               Aggregation aggregation = aggregations.get(iteration);
               if (aggregation != null && aggregation.iteration.getValue() != null) {
                  iterationValues.add(aggregation.iteration.test.iterationsName + " = " + aggregation.iteration.getValue());
               }
            }
         }
View Full Code Here

Examples of org.springframework.data.mongodb.core.aggregation.Aggregation

  @Test
  public void shouldAggregate() {

    createTagDocuments();

    Aggregation agg = newAggregation( //
        project("tags"), //
        unwind("tags"), //
        group("tags") //
            .count().as("n"), //
        project("n") //
View Full Code Here

Examples of org.springframework.data.mongodb.core.aggregation.Aggregation

  }

  @Test
  public void shouldAggregateEmptyCollection() {

    Aggregation aggregation = newAggregation(//
        project("tags"), //
        unwind("tags"), //
        group("tags") //
            .count().as("n"), //
        project("n") //
View Full Code Here

Examples of org.springframework.data.mongodb.core.aggregation.Aggregation

  @Test
  public void shouldDetectResultMismatch() {

    createTagDocuments();

    Aggregation aggregation = newAggregation( //
        project("tags"), //
        unwind("tags"), //
        group("tags") //
            .count().as("count"), // count field not present
        limit(2) //
View Full Code Here

Examples of org.springframework.data.mongodb.core.aggregation.Aggregation

    mongoTemplate.save(user1);
    mongoTemplate.save(user2);
    mongoTemplate.save(user3);

    Aggregation agg = newAggregation( //
        project("id", "msgs"), //
        unwind("msgs"), //
        match(where("msgs.createDate").gt(now.minusDays(1).toDate())), //
        group("id").push("msgs").as("msgs") //
    );
View Full Code Here

Examples of org.springframework.data.mongodb.core.aggregation.Aggregation

    mongoTemplate.save(new Person("p4_first", "p4_last", 15));

    List<DBObject> personsWithAge25 = mongoTemplate.find(Query.query(where("age").is(25)), DBObject.class,
        mongoTemplate.getCollectionName(Person.class));

    Aggregation agg = newAggregation(group("age").push(Aggregation.ROOT).as("users"));
    AggregationResults<DBObject> result = mongoTemplate.aggregate(agg, Person.class, DBObject.class);

    assertThat(result.getMappedResults(), hasSize(3));
    DBObject o = (DBObject) result.getMappedResults().get(2);
View Full Code Here

Examples of org.springframework.data.mongodb.core.aggregation.Aggregation

    mongoTemplate.save(new Reservation("0123", "42", 100));
    mongoTemplate.save(new Reservation("0360", "43", 200));
    mongoTemplate.save(new Reservation("0360", "44", 300));

    Aggregation agg = newAggregation( //
        match(where("hotelCode").is("0360")), //
        sort(Direction.DESC, "confirmationNumber", "timestamp"), //
        group("confirmationNumber") //
            .first("timestamp").as("timestamp") //
            .first(Aggregation.ROOT).as("reservationImage") //
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.