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

Function mergeSameTypeVecs

runtime/vam/expr/arrayexpr.go:133–146  ·  view source on GitHub ↗
(sctx *super.Context, typ super.Type, tags []uint32, vecs []vector.Any)

Source from the content-addressed store, hash-verified

131}
132
133func mergeSameTypeVecs(sctx *super.Context, typ super.Type, tags []uint32, vecs []vector.Any) vector.Any {
134 // XXX This is going to be slow. At some point would nice to write a native
135 // merge of same type vectors.
136 counts := make([]uint32, len(vecs))
137 vb := vector.NewBuilder(typ)
138 var b scode.Builder
139 for _, tag := range tags {
140 b.Truncate()
141 vecs[tag].Serialize(&b, counts[tag])
142 vb.Write(b.Bytes().Body())
143 counts[tag]++
144 }
145 return vb.Build(sctx)
146}

Callers 1

buildListFunction · 0.85

Calls 7

TruncateMethod · 0.95
WriteMethod · 0.95
BytesMethod · 0.95
BuildMethod · 0.95
NewBuilderFunction · 0.92
BodyMethod · 0.80
SerializeMethod · 0.65

Tested by

no test coverage detected