docs: private static void parseMTypeSubQuery(final String query_string, 
        TSQuery data_query) {
      if (query_string == null || query_string.isEmpty()) {
        throw new BadRequestException("The query string was empty");
      }
      
      // m is of the following forms:
      // agg:[interval-agg:][rate:]metric[{tag=value,...}]
      // where the parts in square brackets `[' .. `]' are optional.
      final String[] parts = Tags.splitString(query_string, ':');
      int i = parts.length;
      if (i < 2 || i > 5) {
        throw new BadRequestException("Invalid parameter m=" + query_string + " ("
            + (i < 2 ? "not enough" : "too many") + " :-separated parts)");
      }
      final TSSubQuery sub_query = new TSSubQuery();
      
      // the aggregator is first
      sub_query.setAggregator(parts[0]);
      
      i--; // Move to the last part (the metric name).
      List<TagVFilter> filters = new ArrayList<TagVFilter>();
      sub_query.setMetric(Tags.parseWithMetricAndFilters(parts[i], filters));
      sub_query.setFilters(filters);
      
      // parse out the rate and downsampler 
      for (int x = 1; x < parts.length - 1; x++) {
        if (parts[x].toLowerCase().startsWith("rate")) {
          sub_query.setRate(true);
          if (parts[x].indexOf("{") >= 0) {
            sub_query.setRateOptions(QueryRpc.parseRateOptions(true, parts[x]));
          }
        } else if (Character.isDigit(parts[x].charAt(0))) {
          sub_query.setDownsample(parts[x]);
        } else if (parts[x].equalsIgnoreCase("pre-agg")) {
          sub_query.setPreAggregate(true);
        } else if (parts[x].toLowerCase().startsWith("rollup_")) {
          sub_query.setRollupUsage(parts[x]);
        } else if (parts[x].toLowerCase().startsWith("percentiles")) {
          sub_query.setPercentiles(QueryRpc.parsePercentiles(parts[x]));
        } else if (parts[x].toLowerCase().startsWith("show-histogram-buckets")) {
          sub_query.setShowHistogramBuckets(true);
        } else if (parts[x].toLowerCase().startsWith("explicit_tags")) {
          sub_query.setExplicitTags(true);
        }
      }
      
      if (data_query.getQueries() == null) {
        final ArrayList<TSSubQuery> subs = new ArrayList<TSSubQuery>(1);
        data_query.setQueries(subs);
      }
      data_query.getQueries().add(sub_query);
    }