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

Method Call

runtime/sam/expr/function/flatten.go:27–37  ·  view source on GitHub ↗
(args []super.Value)

Source from the content-addressed store, hash-verified

25}
26
27func (n *Flatten) Call(args []super.Value) super.Value {
28 val := args[0]
29 typ := super.TypeRecordOf(val.Type())
30 if typ == nil {
31 return val
32 }
33 inner := n.innerTypeOf(typ, val.Bytes())
34 n.Reset()
35 n.encode(typ, inner, field.Path{}, val.Bytes())
36 return super.NewValue(n.sctx.LookupTypeArray(inner), n.Bytes())
37}
38
39func (n *Flatten) innerTypeOf(typ *super.TypeRecord, b scode.Bytes) super.Type {
40 n.types = n.appendTypes(n.types[:0], b, typ)

Callers

nothing calls this directly

Calls 8

innerTypeOfMethod · 0.95
encodeMethod · 0.95
TypeRecordOfFunction · 0.92
NewValueFunction · 0.92
LookupTypeArrayMethod · 0.80
TypeMethod · 0.65
BytesMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected