File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,15 @@ import (
26
26
// Project is a projection of certain expression from the children node.
27
27
type Project struct {
28
28
UnaryNode
29
- Projections []sql.Expression
30
- CanDefer bool
31
- deps sql.ColSet
29
+ // Projections are the expressions to be projected on the row returned by the child node
30
+ Projections []sql.Expression
31
+ // CanDefer is true when the projection evaluation can be deferred to row spooling, which allows us to avoid a
32
+ // separate iterator for the project node.
33
+ CanDefer bool
34
+ // IncludesNestedIters is true when the projection includes nested iterators because of expressions that return
35
+ // a RowIter.
36
+ IncludesNestedIters bool
37
+ deps sql.ColSet
32
38
}
33
39
34
40
var _ sql.Expressioner = (* Project )(nil )
@@ -202,8 +208,16 @@ func (p *Project) WithExpressions(exprs ...sql.Expression) (sql.Node, error) {
202
208
return & np , nil
203
209
}
204
210
211
+ // WithCanDefer returns a new Project with the CanDefer field set to the given value.
205
212
func (p * Project ) WithCanDefer (canDefer bool ) * Project {
206
213
np := * p
207
214
np .CanDefer = canDefer
208
215
return & np
209
216
}
217
+
218
+ // WithIncludesNestedIters returns a new Project with the IncludesNestedIters field set to the given value.
219
+ func (p * Project ) WithIncludesNestedIters (includesNestedIters bool ) * Project {
220
+ np := * p
221
+ np .IncludesNestedIters = includesNestedIters
222
+ return & np
223
+ }
You can’t perform that action at this time.
0 commit comments