MCPcopy Create free account
hub / github.com/brimdata/super / Next

Method Next

runtime/sam/expr/fieldnamefinder.go:129–155  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127}
128
129func (f *FieldNameIter) Next() []byte {
130 // Step into non-empty records.
131 for {
132 info := &f.stack[len(f.stack)-1]
133 field := info.fields[info.offset]
134 f.buf = append(f.buf, "."+field.Name...)
135 t, ok := super.TypeUnder(field.Type).(*super.TypeRecord)
136 if !ok || len(t.Fields) == 0 {
137 break
138 }
139 f.stack = append(f.stack, fieldNameIterInfo{t.Fields, 0})
140 }
141 // Skip leading dot.
142 name := f.buf[1:]
143 // Advance our position and step out of records.
144 for len(f.stack) > 0 {
145 info := &f.stack[len(f.stack)-1]
146 field := info.fields[info.offset]
147 f.buf = f.buf[:len(f.buf)-len(field.Name)-1]
148 info.offset++
149 if info.offset < len(info.fields) {
150 break
151 }
152 f.stack = f.stack[:len(f.stack)-1]
153 }
154 return name
155}

Callers 15

TestFieldNameIterFunction · 0.95
compareValuesFunction · 0.45
MatchMethod · 0.45
appendSpreadMethod · 0.45
getNthFromContainerFunction · 0.45
lookupKeyFunction · 0.45
EvalMethod · 0.45
EvalMethod · 0.45
parseArrayOrSetMethod · 0.45
castNextMethod · 0.45
CallMethod · 0.45
toContainerMethod · 0.45

Calls 1

TypeUnderFunction · 0.92

Tested by 1

TestFieldNameIterFunction · 0.76