code: func (api *API) Query(ctx context.Context, req *QueryRequest) (QueryResponse, error) {
  	span, ctx := tracing.StartSpanFromContext(ctx, "API.Query")
  	defer span.Finish()
  
  	if err := api.validate(apiQuery); err != nil {
  		return QueryResponse{}, errors.Wrap(err, "validating api method")
  	}
  
  	q, err := pql.NewParser(strings.NewReader(req.Query)).Parse()
  	if err != nil {
  		return QueryResponse{}, errors.Wrap(err, "parsing")
  	}
  	execOpts := &execOptions{
  		Remote:          req.Remote,
  		ExcludeRowAttrs: req.ExcludeRowAttrs, // NOTE: Kept for Pilosa 1.x compat.
  		ExcludeColumns:  req.ExcludeColumns,  // NOTE: Kept for Pilosa 1.x compat.
  		ColumnAttrs:     req.ColumnAttrs,     // NOTE: Kept for Pilosa 1.x compat.
  	}
  	resp, err := api.server.executor.Execute(ctx, req.Index, q, req.Shards, execOpts)
  	if err != nil {
  		return QueryResponse{}, errors.Wrap(err, "executing")
  	}
  
  	return resp, nil
  }
docs: // Query parses a PQL query out of the request and executes it.