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

Function CheckForNullThenError

runtime/vam/expr/eval.go:18–28  ·  view source on GitHub ↗

CheckForNullThenError returns the first element of vecs with the null type. If no element has the null type, it returns the first element with an error type.

(vecs []vector.Any)

Source from the content-addressed store, hash-verified

16// type. If no element has the null type, it returns the first element with an
17// error type.
18func CheckForNullThenError(vecs []vector.Any) (vector.Any, bool) {
19 var errVec vector.Any
20 for _, vec := range vecs {
21 if k := vec.Kind(); k == vector.KindNull {
22 return vec, true
23 } else if k == vector.KindError && errVec == nil {
24 errVec = vec
25 }
26 }
27 return errVec, errVec != nil
28}
29
30type Call struct {
31 fn Function

Callers 15

CallMethod · 0.92
CallMethod · 0.92
CallMethod · 0.92
CallMethod · 0.92
CallMethod · 0.92
CallMethod · 0.92
CallMethod · 0.92
CallMethod · 0.92
CallMethod · 0.92
CallMethod · 0.92
callMethod · 0.92
CallMethod · 0.92

Calls 1

KindMethod · 0.65

Tested by

no test coverage detected