// PKUpdateFields returns something?  This function doesn't look useful in
// current form.  Perhaps it isn't.
422324
func (f *RelationalModelDefinition) PKUpdateFields(modelname string) string {
	var pkwhere []string
	for _, pk := range f.PrimaryKeys {
		def := fmt.Sprintf("%s.%s", modelname, codegen.Goify(pk.FieldName, true))
		pkwhere = append(pkwhere, def)
	}

	pkw := strings.Join(pkwhere, ",")
	return pkw
}
213381
func (db *RedisDB) hashFields(k string) []string {
	v := db.hashKeys[k]
	r := make([]string, 0, len(v))
	for k := range v {
		r = append(r, k)
	}
	sort.Strings(r)
	return r
}
1282614
func (f *RelationalModelDefinition) IterateFields(it FieldIterator) error {
	// Break out each type of fields

	var pkkeys []string
	pks := make(map[string]string)
	for n := range f.RelationalFields {
		if f.RelationalFields[n].PrimaryKey {
			pks[n] = n
			pkkeys = append(pkkeys, n)
		}
	}
	sort.Strings(pkkeys)

	var namekeys []string
	names := make(map[string]string)
	for n := range f.RelationalFields {
		if !f.RelationalFields[n].PrimaryKey && !f.RelationalFields[n].Timestamp {
			names[n] = n
			namekeys = append(namekeys, n)
		}
	}
	sort.Strings(namekeys)

	var datekeys []string
	dates := make(map[string]string)
	for n := range f.RelationalFields {
		if f.RelationalFields[n].Timestamp {
			dates[n] = n
			datekeys = append(datekeys, n)
		}
	}
	sort.Strings(datekeys)

	// Combine the sorted slices
	var fields []string
	fields = append(fields, pkkeys...)
	fields = append(fields, namekeys...)
	fields = append(fields, datekeys...)

	// Iterate them
	for _, n := range fields {
		if err := it(f.RelationalFields[n]); err != nil {
			return err
		}
	}
	return nil
}
1145631
func (m *MultipartStreamer) WriteFields(fields map[string]string) error {
	var err error

	for key, value := range fields {
		err = m.bodyWriter.WriteField(key, value)
		if err != nil {
			return err
		}
	}

	return nil
}
33683
func cachedTypeFields(t reflect.Type) []field {
	fieldCache.RLock()
	f := fieldCache.m[t]
	fieldCache.RUnlock()
	if f != nil {
		return f
	}

	// Compute fields without lock.
	// Might duplicate effort but won't hold other computations back.
	f = typeFields(t)
	if f == nil {
		f = []field{}
	}

	fieldCache.Lock()
	if fieldCache.m == nil {
		fieldCache.m = map[reflect.Type][]field{}
	}
	fieldCache.m[t] = f
	fieldCache.Unlock()
	return f
}
640749
func (s *DeleteByQueryService) DocvalueFields(docvalueFields ...string) *DeleteByQueryService {
	s.docvalueFields = docvalueFields
	return s
}
844536
func (ckf ComputedKeyFamily) ExportAllPGPKeys() (keys []keybase1.PublicKey) {
	for _, key := range ckf.GetAllActiveSibkeys() {
		if _, isPGP := key.(*PGPKeyBundle); isPGP {
			keys = append(keys, ckf.exportPublicKey(key))
		}
	}
	for _, key := range ckf.GetAllActiveSubkeys() {
		if _, isPGP := key.(*PGPKeyBundle); isPGP {
			keys = append(keys, ckf.exportPublicKey(key))
		}
	}
	sort.Sort(PublicKeyList(keys))
	return keys
}
354723
func (oa *OrderedAggregate) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
	qr, err := oa.Input.GetFields(vcursor, bindVars)
	if err != nil {
		return nil, err
	}
	return qr.Truncate(oa.TruncateColumnCount), nil
}
616352
func AddFields(ctx context.Context, fields ...zapcore.Field) {
	l, ok := ctx.Value(ctxMarkerKey).(*ctxLogger)
	if !ok || l == nil {
		return
	}
	l.fields = append(l.fields, fields...)

}
1364280
func (s *SearchService) StoredField(fieldName string) *SearchService {
	s.searchSource = s.searchSource.StoredField(fieldName)
	return s
}
943986
func (stmt *DeleteStmt) setPkField(arg interface{}, name string) error {
	// Get the type of the interface pointer
	t := reflect.TypeOf(arg)
	if t.Kind() != reflect.Ptr {
		t = reflect.PtrTo(t)
	}

	// TODO There must be an underlying struct
	elem := t.Elem()

	// For each field, try the tag name, then the field name
	// TODO copied from fieldMap, generalize
	for i := 0; i < elem.NumField(); i += 1 {
		f := elem.Field(i)
		tag := f.Tag.Get("db")
		if tag == name || f.Name == name {
			stmt.pkField = i
			return nil
		}
	}
	return fmt.Errorf("aspect: could not find a field for column %s", name)
}
1103550
func (r *RangeOp) Fields(fields []string) *RangeOp {
	r.fieldsToRead = fields
	return r
}
863919
func (table *Table) PKColumns() []*Column {
	columns := make([]*Column, len(table.PrimaryKeys))
	for i, name := range table.PrimaryKeys {
		columns[i] = table.GetColumn(name)
	}
	return columns
}
221699
func executeFieldsSerially(p executeFieldsParams) *Result {
	if p.Source == nil {
		p.Source = map[string]interface{}{}
	}
	if p.Fields == nil {
		p.Fields = map[string][]*ast.Field{}
	}

	finalResults := make(map[string]interface{}, len(p.Fields))
	for responseName, fieldASTs := range p.Fields {
		fieldPath := p.Path.WithKey(responseName)
		resolved, state := resolveField(p.ExecutionContext, p.ParentType, p.Source, fieldASTs, fieldPath)
		if state.hasNoFieldDefs {
			continue
		}
		finalResults[responseName] = resolved
	}
	dethunkMapDepthFirst(finalResults)

	return &Result{
		Data:   finalResults,
		Errors: p.ExecutionContext.Errors,
	}
}
1285479
func (s *ScanOp) Fields(fields []string) *ScanOp {
	s.fieldsToRead = fields
	return s
}
1215404
func (s *UpdateByQueryService) StoredFields(storedFields ...string) *UpdateByQueryService {
	s.storedFields = storedFields
	return s
}
234001
func DropDisabledTemplateFields(podTemplate, oldPodTemplate *api.PodTemplateSpec) {
	var (
		podSpec           *api.PodSpec
		podAnnotations    map[string]string
		oldPodSpec        *api.PodSpec
		oldPodAnnotations map[string]string
	)
	if podTemplate != nil {
		podSpec = &podTemplate.Spec
		podAnnotations = podTemplate.Annotations
	}
	if oldPodTemplate != nil {
		oldPodSpec = &oldPodTemplate.Spec
		oldPodAnnotations = oldPodTemplate.Annotations
	}
	dropDisabledFields(podSpec, podAnnotations, oldPodSpec, oldPodAnnotations)
}