diff --git a/compiler/kernel/vop.go b/compiler/kernel/vop.go index 98e72d6717..5e569e6589 100644 --- a/compiler/kernel/vop.go +++ b/compiler/kernel/vop.go @@ -202,6 +202,9 @@ func (b *Builder) compileVamLeaf(o dag.Op, parent vector.Puller) (vector.Puller, return vamop.NewFilter(b.zctx(), parent, e), nil case *dag.Head: return vamop.NewHead(parent, o.Count), nil + case *dag.NullScan: + return vam.NewDematerializer(zbuf.NewPuller(zbuf.NewArray([]super.Value{super.Null}))), nil + case *dag.Output: b.channels[o.Name] = append(b.channels[o.Name], vam.NewMaterializer(parent)) return parent, nil diff --git a/vector/any.go b/vector/any.go index 8fbfd22bc3..3c4dcbe02b 100644 --- a/vector/any.go +++ b/vector/any.go @@ -20,3 +20,20 @@ type Promotable interface { type Puller interface { Pull(done bool) (Any, error) } + +type puller struct { + vecs []Any +} + +func NewPuller(vecs ...Any) Puller { + return &puller{vecs} +} + +func (p *puller) Pull(_ bool) (Any, error) { + if len(p.vecs) == 0 { + return nil, nil + } + vec := p.vecs[0] + p.vecs = p.vecs[1:] + return vec, nil +}