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

Method Call

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

Source from the content-addressed store, hash-verified

25}
26
27func (u *UDF) Call(args []super.Value) super.Value {
28 u.stackDepth++
29 if u.stackDepth > MaxStackDepth {
30 return u.sctx.NewErrorf("stack overflow in function %q", u.name)
31 }
32 defer func() { u.stackDepth-- }()
33 if len(args) == 0 {
34 return u.Body.Eval(super.Null)
35 }
36 u.builder.Reset()
37 for i, a := range args {
38 u.fields[i].Type = a.Type()
39 u.builder.Append(a.Bytes())
40 }
41 typ := u.sctx.MustLookupTypeRecord(u.fields)
42 return u.Body.Eval(super.NewValue(typ, u.builder.Bytes()))
43}

Callers

nothing calls this directly

Calls 8

NewValueFunction · 0.92
NewErrorfMethod · 0.80
MustLookupTypeRecordMethod · 0.80
EvalMethod · 0.65
TypeMethod · 0.65
ResetMethod · 0.45
AppendMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected