processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java
/**
   * Rewrite the aggregator and dimension specs since the push down nested query will return
   * results with dimension and aggregation specs of the original nested query.
   */
Rewrite the aggregator and dimension specs since the push down nested query will return
results with dimension and aggregation specs of the original nested query.
Rewrite the aggregator and dimension specs since the push down nested query will return results with dimension and aggregation specs of the original nested query .
@VisibleForTesting
  GroupByQuery rewriteNestedQueryForPushDown(GroupByQuery query)
  {
    return query.withAggregatorSpecs(Lists.transform(query.getAggregatorSpecs(), (agg) -> agg.getCombiningFactory()))
                .withDimensionSpecs(Lists.transform(
                    query.getDimensions(),
                    (dim) -> new DefaultDimensionSpec(
                        dim.getOutputName(),
                        dim.getOutputName(),
                        dim.getOutputType()
                    )
                ));
  }
@ VisibleForTesting GroupByQuery rewriteNestedQueryForPushDown ( GroupByQuery query ) { return query . withAggregatorSpecs ( Lists . transform ( query . getAggregatorSpecs ( ) , ( agg ) -> agg . getCombiningFactory ( ) ) ) . withDimensionSpecs ( Lists . transform ( query . getDimensions ( ) , ( dim ) -> new DefaultDimensionSpec ( dim . getOutputName ( ) , dim . getOutputName ( ) , dim . getOutputType ( ) ) ) ) ; }
Rewrite the aggregator and dimension specs since the push down nested query will return
 results with dimension and aggregation specs of the original nested query.
Rewrite the aggregator and dimension specs since the push down nested query will return results with dimension and aggregation specs of the original nested query .