@Override public TemplateDruidQuery updateOuterQuery(TemplateDruidQuery outerQuery,Map<String,String> oldFieldNameToNewFieldNameMap){
  Map<String,Aggregation> oldNameToNewAggregationMapping=new HashMap<>();
  Set<Aggregation> updatedOuterAggs=updateQueryAggs(outerQuery.getAggregations(),oldFieldNameToNewFieldNameMap,oldNameToNewAggregationMapping);
  Set<PostAggregation> updateOuterPostAggs=new HashSet<>();
  for (  PostAggregation postAggregation : outerQuery.getPostAggregations()) {
    updateOuterPostAggs.add(replacePostAggWithPostAggFromMap(postAggregation,oldNameToNewAggregationMapping));
  }
  return new TemplateDruidQuery(updatedOuterAggs,updateOuterPostAggs,outerQuery.getInnerQuery(),outerQuery.getTimeGrain());
}

@ Override public TemplateDruidQuery updateOuterQuery ( TemplateDruidQuery outerQuery , Map < String , String > oldFieldNameToNewFieldNameMap ) { Map < String , Aggregation > oldNameToNewAggregationMapping = new HashMap < > ( ) ; Set < Aggregation > updatedOuterAggs = updateQueryAggs ( outerQuery . getAggregations ( ) , oldFieldNameToNewFieldNameMap , oldNameToNewAggregationMapping ) ; Set < PostAggregation > updateOuterPostAggs = new HashSet < > ( ) ; for ( PostAggregation postAggregation : outerQuery . getPostAggregations ( ) ) { updateOuterPostAggs . add ( replacePostAggWithPostAggFromMap ( postAggregation , oldNameToNewAggregationMapping ) ) ; } return new TemplateDruidQuery ( updatedOuterAggs , updateOuterPostAggs , outerQuery . getInnerQuery ( ) , outerQuery . getTimeGrain ( ) ) ; }
a method to update outer query aggregations & amp ; postaggregations .
