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

Method Eval

runtime/vam/expr/arrayexpr.go:26–42  ·  view source on GitHub ↗
(this vector.Any)

Source from the content-addressed store, hash-verified

24}
25
26func (a *ArrayExpr) Eval(this vector.Any) vector.Any {
27 if len(a.elems) == 0 {
28 typ := a.sctx.LookupTypeArray(super.TypeNull)
29 offsets := make([]uint32, this.Len()+1)
30 nullVec := vector.NewNull(0)
31 return vector.NewArray(typ, offsets, nullVec)
32 }
33 var vecs []vector.Any
34 for _, e := range a.elems {
35 if e.Spread != nil {
36 vecs = append(vecs, e.Spread.Eval(this))
37 } else {
38 vecs = append(vecs, e.Value.Eval(this))
39 }
40 }
41 return vector.Apply(false, a.eval, vecs...)
42}
43
44func (a *ArrayExpr) eval(in ...vector.Any) vector.Any {
45 offsets, inner := buildList(a.sctx, a.elems, in)

Callers

nothing calls this directly

Calls 6

NewNullFunction · 0.92
NewArrayFunction · 0.92
ApplyFunction · 0.92
LookupTypeArrayMethod · 0.80
LenMethod · 0.65
EvalMethod · 0.65

Tested by

no test coverage detected