Skip to content

Commit dffd1c7

Browse files
authored
Add checking empty batch of join (#2989)
1 parent 8c7a5e7 commit dffd1c7

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

pkg/sql/colexec2/complement/complement.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ func (ctr *Container) build(ap *Argument, proc *process.Process) error {
143143
}
144144
bat.Clean(proc.Mp)
145145
}
146+
if ctr.bat == nil || len(ctr.bat.Zs) == 0 {
147+
return nil
148+
}
146149
for i, cond := range ap.Conditions[1] {
147150
vec, err := colexec.EvalExpr(ctr.bat, proc, cond.Expr)
148151
if err != nil {

pkg/sql/colexec2/join/join.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ func (ctr *Container) build(ap *Argument, proc *process.Process) error {
154154
}
155155
bat.Clean(proc.Mp)
156156
}
157+
if ctr.bat == nil || len(ctr.bat.Zs) == 0 {
158+
return nil
159+
}
157160
for i, cond := range ap.Conditions[1] {
158161
vec, err := colexec.EvalExpr(ctr.bat, proc, cond.Expr)
159162
if err != nil {

pkg/sql/colexec2/left/join.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ func (ctr *Container) build(ap *Argument, proc *process.Process) error {
154154
}
155155
bat.Clean(proc.Mp)
156156
}
157+
if ctr.bat == nil || len(ctr.bat.Zs) == 0 {
158+
return nil
159+
}
157160
for i, cond := range ap.Conditions[1] {
158161
vec, err := colexec.EvalExpr(ctr.bat, proc, cond.Expr)
159162
if err != nil {

pkg/sql/colexec2/semi/join.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ func (ctr *Container) build(ap *Argument, proc *process.Process) error {
143143
}
144144
bat.Clean(proc.Mp)
145145
}
146+
if ctr.bat == nil || len(ctr.bat.Zs) == 0 {
147+
return nil
148+
}
146149
for i, cond := range ap.Conditions[1] {
147150
vec, err := colexec.EvalExpr(ctr.bat, proc, cond.Expr)
148151
if err != nil {

0 commit comments

Comments
 (0)