@Test void should_build_type_mapping_for_field_reference_of_keyword() { assertThat( buildTypeMapping(Arrays.asList( named("avg(age)", new AvgAggregator(Arrays.asList(ref("age", INTEGER)), INTEGER))), Arrays.asList(named("name", ref("name", ES_TEXT_KEYWORD)))), containsInAnyOrder( map("avg(age)", INTEGER), map("name", ES_TEXT_KEYWORD) )); }
public Map<String, ExprType> buildTypeMapping( List<NamedAggregator> namedAggregatorList, List<NamedExpression> groupByList) { ImmutableMap.Builder<String, ExprType> builder = new ImmutableMap.Builder<>(); namedAggregatorList.forEach(agg -> builder.put(agg.getName(), agg.type())); groupByList.forEach(group -> builder.put(group.getName(), group.type())); return builder.build(); }
AggregationQueryBuilder extends ExpressionNodeVisitor<AggregationBuilder, Object> { public Map<String, ExprType> buildTypeMapping( List<NamedAggregator> namedAggregatorList, List<NamedExpression> groupByList) { ImmutableMap.Builder<String, ExprType> builder = new ImmutableMap.Builder<>(); namedAggregatorList.forEach(agg -> builder.put(agg.getName(), agg.type())); groupByList.forEach(group -> builder.put(group.getName(), group.type())); return builder.build(); } }
AggregationQueryBuilder extends ExpressionNodeVisitor<AggregationBuilder, Object> { public Map<String, ExprType> buildTypeMapping( List<NamedAggregator> namedAggregatorList, List<NamedExpression> groupByList) { ImmutableMap.Builder<String, ExprType> builder = new ImmutableMap.Builder<>(); namedAggregatorList.forEach(agg -> builder.put(agg.getName(), agg.type())); groupByList.forEach(group -> builder.put(group.getName(), group.type())); return builder.build(); } AggregationQueryBuilder(
      ExpressionSerializer serializer); }
AggregationQueryBuilder extends ExpressionNodeVisitor<AggregationBuilder, Object> { public Map<String, ExprType> buildTypeMapping( List<NamedAggregator> namedAggregatorList, List<NamedExpression> groupByList) { ImmutableMap.Builder<String, ExprType> builder = new ImmutableMap.Builder<>(); namedAggregatorList.forEach(agg -> builder.put(agg.getName(), agg.type())); groupByList.forEach(group -> builder.put(group.getName(), group.type())); return builder.build(); } AggregationQueryBuilder(
      ExpressionSerializer serializer); List<AggregationBuilder> buildAggregationBuilder(List<NamedAggregator> namedAggregatorList,
                                                          List<NamedExpression> groupByList); Map<String, ExprType> buildTypeMapping(
      List<NamedAggregator> namedAggregatorList,
      List<NamedExpression> groupByList); }
AggregationQueryBuilder extends ExpressionNodeVisitor<AggregationBuilder, Object> { public Map<String, ExprType> buildTypeMapping( List<NamedAggregator> namedAggregatorList, List<NamedExpression> groupByList) { ImmutableMap.Builder<String, ExprType> builder = new ImmutableMap.Builder<>(); namedAggregatorList.forEach(agg -> builder.put(agg.getName(), agg.type())); groupByList.forEach(group -> builder.put(group.getName(), group.type())); return builder.build(); } AggregationQueryBuilder(
      ExpressionSerializer serializer); List<AggregationBuilder> buildAggregationBuilder(List<NamedAggregator> namedAggregatorList,
                                                          List<NamedExpression> groupByList); Map<String, ExprType> buildTypeMapping(
      List<NamedAggregator> namedAggregatorList,
      List<NamedExpression> groupByList); static final int AGGREGATION_BUCKET_SIZE; }