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

Method Call

runtime/vam/expr/function/types.go:170–189  ·  view source on GitHub ↗
(args ...vector.Any)

Source from the content-addressed store, hash-verified

168}
169
170func (t *TypeName) Call(args ...vector.Any) vector.Any {
171 vec := vector.Under(args[0])
172 if vec.Type() != super.TypeString {
173 return vector.NewWrappedError(t.sctx, "typename: argument must be a string", args[0])
174 }
175 var errs []uint32
176 out := vector.NewTypeValueEmpty(0)
177 for i := range vec.Len() {
178 s := vector.StringValue(vec, i)
179 if typ := t.sctx.LookupTypeDef(s); typ == nil {
180 errs = append(errs, i)
181 } else {
182 out.Append(t.sctx.LookupTypeValue(typ).Bytes())
183 }
184 }
185 if len(errs) > 0 {
186 return vector.Combine(out, errs, vector.NewMissing(t.sctx, uint32(len(errs))))
187 }
188 return out
189}
190
191type Error struct {
192 sctx *super.Context

Callers

nothing calls this directly

Calls 12

UnderFunction · 0.92
NewWrappedErrorFunction · 0.92
NewTypeValueEmptyFunction · 0.92
StringValueFunction · 0.92
CombineFunction · 0.92
NewMissingFunction · 0.92
LookupTypeDefMethod · 0.80
LookupTypeValueMethod · 0.80
TypeMethod · 0.65
LenMethod · 0.65
AppendMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected