Skip to content

Commit

Permalink
Revert "executor: split hashjoin part4 (pingcap#39155)"
Browse files Browse the repository at this point in the history
This reverts commit fee8ed7.
  • Loading branch information
XuHuaiyu committed Dec 26, 2022
1 parent 4208b1e commit 2e77815
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 187 deletions.
5 changes: 1 addition & 4 deletions executor/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,12 +920,12 @@ func prepare4HashJoin(testCase *hashJoinTestCase, innerExec, outerExec Executor)
joinType: testCase.joinType, // 0 for InnerJoin, 1 for LeftOutersJoin, 2 for RightOuterJoin
isOuterJoin: false,
useOuterToBuild: testCase.useOuterToBuild,
concurrency: uint(testCase.concurrency),
},
probeSideTupleFetcher: &probeSideTupleFetcher{
probeSideExec: outerExec,
},
probeWorkers: make([]probeWorker, testCase.concurrency),
concurrency: uint(testCase.concurrency),
buildKeys: joinKeys,
probeKeys: probeKeys,
buildSideExec: innerExec,
Expand All @@ -936,9 +936,6 @@ func prepare4HashJoin(testCase *hashJoinTestCase, innerExec, outerExec Executor)
defaultValues := make([]types.Datum, e.buildSideExec.Schema().Len())
lhsTypes, rhsTypes := retTypes(innerExec), retTypes(outerExec)
for i := uint(0); i < e.concurrency; i++ {
e.probeWorkers[i].workerID = i
e.probeWorkers[i].sessCtx = e.ctx
e.probeWorkers[i].hashJoinCtx = e.hashJoinCtx
e.probeWorkers[i].joiner = newJoiner(testCase.ctx, e.joinType, true, defaultValues,
nil, lhsTypes, rhsTypes, childrenUsedSchema, false)
}
Expand Down
6 changes: 1 addition & 5 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1429,8 +1429,8 @@ func (b *executorBuilder) buildHashJoin(v *plannercore.PhysicalHashJoin) Executo
isOuterJoin: v.JoinType.IsOuterJoin(),
useOuterToBuild: v.UseOuterToBuild,
joinType: v.JoinType,
concurrency: v.Concurrency,
},
concurrency: v.Concurrency,
}
defaultValues := v.DefaultValues
lhsTypes, rhsTypes := retTypes(leftExec), retTypes(rightExec)
Expand Down Expand Up @@ -1484,13 +1484,9 @@ func (b *executorBuilder) buildHashJoin(v *plannercore.PhysicalHashJoin) Executo
childrenUsedSchema := markChildrenUsedCols(v.Schema(), v.Children()[0].Schema(), v.Children()[1].Schema())
e.probeWorkers = make([]probeWorker, e.concurrency)
for i := uint(0); i < e.concurrency; i++ {
e.probeWorkers[i].hashJoinCtx = e.hashJoinCtx
e.probeWorkers[i].workerID = i
e.probeWorkers[i].sessCtx = e.ctx
e.probeWorkers[i].joiner = newJoiner(b.ctx, v.JoinType, v.InnerChildIdx == 0, defaultValues,
v.OtherConditions, lhsTypes, rhsTypes, childrenUsedSchema, isNAJoin)
}
e.hashJoinCtx.isNullAware = isNAJoin
executorCountHashJoinExec.Inc()

// We should use JoinKey to construct the type information using by hashing, instead of using the child's schema directly.
Expand Down
Loading

0 comments on commit 2e77815

Please sign in to comment.