Skip to content

Commit fa52ced

Browse files
committed
vam: Support NullScan
1 parent 1fd40f5 commit fa52ced

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

compiler/kernel/vop.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ func (b *Builder) compileVamLeaf(o dag.Op, parent vector.Puller) (vector.Puller,
202202
return vamop.NewFilter(b.zctx(), parent, e), nil
203203
case *dag.Head:
204204
return vamop.NewHead(parent, o.Count), nil
205+
case *dag.NullScan:
206+
return vector.NewPuller(vector.NewConst(super.Null, 1, nil)), nil
205207
case *dag.Output:
206208
b.channels[o.Name] = append(b.channels[o.Name], vam.NewMaterializer(parent))
207209
return parent, nil

vector/any.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,20 @@ type Promotable interface {
2020
type Puller interface {
2121
Pull(done bool) (Any, error)
2222
}
23+
24+
type puller struct {
25+
vecs []Any
26+
}
27+
28+
func NewPuller(vecs ...Any) Puller {
29+
return &puller{vecs}
30+
}
31+
32+
func (p *puller) Pull(_ bool) (Any, error) {
33+
if len(p.vecs) == 0 {
34+
return nil, nil
35+
}
36+
vec := p.vecs[0]
37+
p.vecs = p.vecs[1:]
38+
return vec, nil
39+
}

0 commit comments

Comments
 (0)