Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exec: fix a bug with ON expression support for joiners #40651

Merged
merged 1 commit into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/sql/exec/hashjoiner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func TestHashJoinerInt64(t *testing.T) {
}
}

// TODO(yuzefovich): add unit tests for cases with ON expression.
tcs := []struct {
leftTypes []coltypes.T
rightTypes []coltypes.T
Expand Down
4 changes: 4 additions & 0 deletions pkg/sql/exec/joiner_util_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ func (f *joinerFilter) setInputBatch(lBatch, rBatch coldata.Batch, lIdx, rIdx in
execerror.VectorizedInternalPanic("only one of lBatch and rBatch can be nil")
}
setOneSide := func(colOffset int, batch coldata.Batch, sourceTypes []coltypes.T, idx int) {
sel := batch.Selection()
if sel != nil {
idx = int(sel[idx])
}
for colIdx := 0; colIdx < batch.Width(); colIdx++ {
colType := sourceTypes[colIdx]
col := batch.ColVec(colIdx)
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/exec/mergejoiner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type mjTestInitializer interface {
initWithBatchSize(outBatchSize uint16)
}

// TODO(yuzefovich): add unit tests for cases with ON expression.

type mjTestCase struct {
description string
joinType sqlbase.JoinType
Expand Down