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

Method Call

runtime/vam/expr/function/flatten.go:19–34  ·  view source on GitHub ↗
(args ...vector.Any)

Source from the content-addressed store, hash-verified

17}
18
19func (f *flatten) Call(args ...vector.Any) vector.Any {
20 vec := vector.Under(args[0])
21 rtyp := super.TypeRecordOf(vec.Type())
22 if rtyp == nil {
23 return args[0]
24 }
25 builder := vector.NewDynamicBuilder()
26 var b scode.Builder
27 for i := range vec.Len() {
28 b.Truncate()
29 vec.Serialize(&b, i)
30 val := f.fn.Call([]super.Value{super.NewValue(rtyp, b.Bytes().Body())})
31 builder.Write(val)
32 }
33 return builder.Build(f.sctx)
34}
35
36type unflatten struct {
37 sctx *super.Context

Callers

nothing calls this directly

Calls 13

TruncateMethod · 0.95
BytesMethod · 0.95
WriteMethod · 0.95
BuildMethod · 0.95
UnderFunction · 0.92
TypeRecordOfFunction · 0.92
NewDynamicBuilderFunction · 0.92
NewValueFunction · 0.92
BodyMethod · 0.80
TypeMethod · 0.65
LenMethod · 0.65
SerializeMethod · 0.65

Tested by

no test coverage detected