diff --git a/pkg/sql/exec/hashjoiner_test.go b/pkg/sql/exec/hashjoiner_test.go index 5325ab911d00..aa27ef52b43e 100644 --- a/pkg/sql/exec/hashjoiner_test.go +++ b/pkg/sql/exec/hashjoiner_test.go @@ -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 diff --git a/pkg/sql/exec/joiner_util_tmpl.go b/pkg/sql/exec/joiner_util_tmpl.go index 05cb7d9d326b..42b372594e3b 100644 --- a/pkg/sql/exec/joiner_util_tmpl.go +++ b/pkg/sql/exec/joiner_util_tmpl.go @@ -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) diff --git a/pkg/sql/exec/mergejoiner_test.go b/pkg/sql/exec/mergejoiner_test.go index d0e955431c88..6f764230cfea 100644 --- a/pkg/sql/exec/mergejoiner_test.go +++ b/pkg/sql/exec/mergejoiner_test.go @@ -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