docs: public void validateAndSetQuery() {
      if (start == null || start.isEmpty()) {
        throw new IllegalArgumentException("Missing start time");
      }
      start_time = DateTime.parseDateTimeString(start, timezone);
      
      if (end != null && !end.isEmpty()) {
        end_time = DateTime.parseDateTimeString(end, timezone);
      } else {
        end_time = System.currentTimeMillis();
      }
      if (end_time <= start_time) {
        throw new IllegalArgumentException(
            "End time [" + end_time + "] must be greater than the start time ["
            + start_time +"]");
      }
      
      if (queries == null || queries.isEmpty()) {
        throw new IllegalArgumentException("Missing queries");
      }
      
      // validate queries
      int i = 0;
      for (TSSubQuery sub : queries) {
        sub.validateAndSetQuery();
        final DownsamplingSpecification ds = sub.downsamplingSpecification();
        if (ds != null && timezone != null && !timezone.isEmpty() && 
            ds != DownsamplingSpecification.NO_DOWNSAMPLER) {
          final TimeZone tz = DateTime.timezones.get(timezone);
          if (tz == null) {
            throw new IllegalArgumentException(
                "The timezone specification could not be found");
          }
          ds.setTimezone(tz);
        }
        if (ds != null && use_calendar && 
            ds != DownsamplingSpecification.NO_DOWNSAMPLER) {
          ds.setUseCalendar(true);
        }
        
        sub.setIndex(i++);
      }
    }