code: private Map<String, Object> buildRecords(ListIterable<Expression> iterable, InternalAggregations internalAgg)
      {
          Map<String, Object> temp = new HashMap<>();
          Iterator<Expression> itr = iterable.iterator();
  
          while (itr.hasNext())
          {
              Expression exp = itr.next();
              if (AggregateFunction.class.isAssignableFrom(exp.getClass()))
              {
                  Object value = getAggregatedResult(internalAgg, ((AggregateFunction) exp).getIdentifier(), exp);
                  if (!value.toString().equalsIgnoreCase(ESConstants.INFINITY))
                  {
                      temp.put(exp.toParsedText(), Double.valueOf(value.toString()));
                  }
              }
          }
  
          return temp;
      }
docs: Builds the records.
  
  @param iterable
  the iterable
  @param internalAgg
  the internal agg
  @return the map