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

Method Call

runtime/vam/expr/function/errors.go:12–37  ·  view source on GitHub ↗
(args ...vector.Any)

Source from the content-addressed store, hash-verified

10}
11
12func (q *Quiet) Call(args ...vector.Any) vector.Any {
13 arg, ok := vector.Opt(args[0]).(*vector.Error)
14 if !ok {
15 return args[0]
16 }
17 if _, ok := arg.Vals.Type().(*super.TypeOfString); !ok {
18 return args[0]
19 }
20 if _, ok := arg.Vals.(*vector.Const); ok {
21 // Fast path
22 if vector.StringValue(arg.Vals, 0) == "missing" {
23 return vector.NewStringError(q.sctx, "quiet", arg.Len())
24 }
25 return args[0]
26 }
27 n := arg.Len()
28 vec := vector.NewStringEmpty(n)
29 for i := range n {
30 s := vector.StringValue(arg.Vals, i)
31 if s == "missing" {
32 s = "quiet"
33 }
34 vec.Append(s)
35 }
36 return vector.NewError(arg.Typ, vec)
37}

Callers

nothing calls this directly

Calls 8

OptFunction · 0.92
StringValueFunction · 0.92
NewStringErrorFunction · 0.92
NewStringEmptyFunction · 0.92
NewErrorFunction · 0.92
TypeMethod · 0.65
LenMethod · 0.65
AppendMethod · 0.45

Tested by

no test coverage detected