// Select sets the selected cell. Depending on the selection settings
// specified via SetSelectable(), this may be an entire row or column, or even
// ignored completely.
342195
func (t *Table) Select(row, column int) *Table {
	t.selectedRow, t.selectedColumn = row, column
	return t
}
147232
func (s *Selection) AppendSelection(sel *Selection) *Selection {
	return s.AppendNodes(sel.Nodes...)
}
1219403
func (engine *Engine) Select(str string) *Session {
	session := engine.NewSession()
	session.isAutoClose = true
	return session.Select(str)
}
405195
func (t *Table) GetSelectable() (rows, columns bool) {
	return t.rowsSelectable, t.columnsSelectable
}
945430
func (statement *Statement) Select(str string) *Statement {
	statement.selectStr = str
	return statement
}
1079687
func (s *QueryInput) SetSelect(v string) *QueryInput {
	s.Select = &v
	return s
}
172830
func (b *Broker) Select(dialOpts ...grpc.DialOption) (*Conn, error) {
	b.mu.Lock()
	localConn := b.localConn
	b.mu.Unlock()

	if localConn != nil {
		return &Conn{
			ClientConn: localConn,
			isLocal:    true,
		}, nil
	}

	return b.SelectRemote(dialOpts...)
}
659076
func SELECT(entity interface{}, afterKeyword Expression, binding ...interface{}) Expression {
	return &PrefixedExp{"SELECT", []Expression{FROM(entity, afterKeyword)}, "", binding}
}
564820
func (s *SelectQuery) AndSelect(cols ...string) *SelectQuery {
	s.selects = append(s.selects, cols...)
	return s
}
809242
func Select(a Type, x interface{}) Type {
	switch a := a.(type) {
	case *Array:
		n, ok := x.(json.Number)
		if !ok {
			return nil
		}
		pos, err := n.Int64()
		if err != nil {
			return nil
		}
		return a.Select(int(pos))
	case *Object:
		return a.Select(x)
	case *Set:
		tpe := TypeOf(x)
		if Compare(a.of, tpe) == 0 {
			return a.of
		}
		if any, ok := a.of.(Any); ok {
			if any.Contains(tpe) {
				return tpe
			}
		}
		return nil
	case Any:
		if Compare(a, A) == 0 {
			return A
		}
		var tpe Type
		for i := range a {
			// TODO(tsandall): test nil/nil
			tpe = Or(Select(a[i], x), tpe)
		}
		return tpe
	default:
		return nil
	}
}
51238
func (ca Actions) Selection() []string {
	keys := make([]string, 0, len(ca))
	for _, a := range ca {
		keys = append(keys, a.Name)
	}
	return keys
}
56783
func (p *Pollster) Select(l List) (string, error) {
	return p.SelectVerify(l, VerifyOptions(l.Singular, l.Options, l.Default != ""))
}
424260
func (db *baseDB) Select(model interface{}) error {
	return orm.Select(db.db, model)
}
723432
func (this *Engine) RawSelect(fields string, table string, where string, params ...interface{}) SelectRows {
	if fields == "" {
		fields = "*"
	} else {
		fields = this.ReplaceTablePrefix(fields)
	}
	sql := `SELECT ` + fields + ` FROM ` + this.fullTableName(table) + ` WHERE ` + this.ReplaceTablePrefix(where)
	if len(params) == 1 {
		switch params[0].(type) {
		case []interface{}:
			return this.GetRows(sql, params[0].([]interface{})...)
		}
	}
	return SelectRows(this.GetRows(sql, params...))
}
1123288
func (l *lru) Select(aps []AvailablePlugin, _ string) (AvailablePlugin, error) {
	t := time.Now()
	index := -1
	for i, ap := range aps {
		// look for the least recently used
		if ap.LastHit().Before(t) || index == -1 {
			index = i
			t = ap.LastHit()
		}
	}
	if index > -1 {
		l.logger.WithFields(log.Fields{
			"block":     "select",
			"strategy":  l.String(),
			"pool size": len(aps),
			"index":     aps[index].String(),
			"hitcount":  aps[index].HitCount(),
		}).Debug("plugin selected")
		return aps[index], nil
	}
	l.logger.WithFields(log.Fields{
		"block":    "select",
		"strategy": l.String(),
		"error":    ErrCouldNotSelect,
	}).Error("error selecting")
	return nil, ErrCouldNotSelect
}
669454
func (q *querier) Select(matchers ...*labels.Matcher) (storage.SeriesSet, error) {
	minFrom := uint32(math.MaxUint32)
	var maxTo uint32
	var target string
	var reqs []models.Req

	expressions := []string{}
	for _, matcher := range matchers {
		if matcher.Name == model.MetricNameLabel {
			matcher.Name = "name"
		}
		if matcher.Type == labels.MatchNotRegexp {
			expressions = append(expressions, fmt.Sprintf("%s!=~%s", matcher.Name, matcher.Value))
		} else {
			expressions = append(expressions, fmt.Sprintf("%s%s%s", matcher.Name, matcher.Type, matcher.Value))
		}
	}

	series, err := q.clusterFindByTag(q.ctx, q.OrgID, expressions, 0, maxSeriesPerReq)
	if err != nil {
		return nil, err
	}

	if q.metadataOnly {
		return BuildMetadataSeriesSet(series)
	}

	minFrom = util.Min(minFrom, q.from)
	maxTo = util.Max(maxTo, q.to)
	for _, s := range series {
		for _, metric := range s.Series {
			for _, archive := range metric.Defs {
				consReq := consolidation.None
				fn := mdata.Aggregations.Get(archive.AggId).AggregationMethod[0]
				cons := consolidation.Consolidator(fn)

				newReq := models.NewReq(archive.Id, archive.NameWithTags(), target, q.from, q.to, math.MaxUint32, uint32(archive.Interval), cons, consReq, s.Node, archive.SchemaId, archive.AggId)
				reqs = append(reqs, newReq)
			}
		}
	}

	select {
	case <-q.ctx.Done():
		//request canceled
		return nil, fmt.Errorf("request canceled")
	default:
	}

	reqRenderSeriesCount.Value(len(reqs))
	if len(reqs) == 0 {
		return nil, fmt.Errorf("no series found")
	}

	// note: if 1 series has a movingAvg that requires a long time range extension, it may push other reqs into another archive. can be optimized later
	reqs, _, _, err = alignRequests(uint32(time.Now().Unix()), minFrom, maxTo, reqs)
	if err != nil {
		log.Errorf("HTTP Render alignReq error: %s", err.Error())
		return nil, err
	}

	out, err := q.getTargets(q.ctx, reqs)
	if err != nil {
		log.Errorf("HTTP Render %s", err.Error())
		return nil, err
	}

	return SeriesToSeriesSet(out)
}
488952
func (t *Table) GetSelection() (row, column int) {
	return t.selectedRow, t.selectedColumn
}