code: func (sink *influxdbSink) composeRawQuery(metricName string, labels map[string]string, metricKeys []core.HistoricalKey, start, end time.Time) string {
  	seriesName, fieldName := sink.metricToSeriesAndField(metricName)
  
  	queries := make([]string, len(metricKeys))
  	for i, key := range metricKeys {
  		pred := sink.keyToSelector(key)
  		if labels != nil {
  			pred += fmt.Sprintf(" AND %s", sink.labelsToPredicate(labels))
  		}
  		if !start.IsZero() {
  			pred += fmt.Sprintf(" AND time > '%s'", start.Format(time.RFC3339))
  		}
  		if !end.IsZero() {
  			pred += fmt.Sprintf(" AND time < '%s'", end.Format(time.RFC3339))
  		}
  		queries[i] = fmt.Sprintf("SELECT time, %q FROM %q WHERE %s", fieldName, seriesName, pred)
  	}
  
  	return strings.Join(queries, "; ")
  }
docs: // composeRawQuery creates the InfluxQL query to fetch the given metric values