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

Method build

vector/recordbuilder.go:59–74  ·  view source on GitHub ↗
(sctx *super.Context, leafs []Any)

Source from the content-addressed store, hash-verified

57}
58
59func (r *rec) build(sctx *super.Context, leafs []Any) (*Record, []Any) {
60 var fields []super.Field
61 var out []Any
62 for i, name := range r.paths {
63 var vec Any
64 if r.recs[i] != nil {
65 vec, leafs = r.recs[i].build(sctx, leafs)
66 } else {
67 vec, leafs = leafs[0], leafs[1:]
68 }
69 fields = append(fields, super.NewField(name, vec.Type()))
70 out = append(out, vec)
71 }
72 typ := sctx.MustLookupTypeRecord(fields)
73 return NewRecord(typ, out, out[0].Len()), leafs
74}

Callers 1

NewMethod · 0.45

Calls 5

TypeMethod · 0.95
NewFieldFunction · 0.92
NewRecordFunction · 0.85
MustLookupTypeRecordMethod · 0.80
LenMethod · 0.65

Tested by

no test coverage detected