Skip to content

Commit

Permalink
rename some variables
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-jason committed Aug 6, 2018
1 parent 0207e91 commit 6b74d45
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 178 deletions.
10 changes: 5 additions & 5 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func (b *executorBuilder) buildMergeJoin(v *plan.PhysicalMergeJoin) Executor {
e := &MergeJoinExec{
stmtCtx: b.ctx.GetSessionVars().StmtCtx,
baseExecutor: newBaseExecutor(b.ctx, v.Schema(), v.ExplainID(), leftExec, rightExec),
resultGenerator: newJoinResultGenerator(b.ctx, v.JoinType, v.JoinType == plan.RightOuterJoin,
resultGenerator: newRecordJoiner(b.ctx, v.JoinType, v.JoinType == plan.RightOuterJoin,
defaultValues, v.OtherConditions,
leftExec.retTypes(), rightExec.retTypes()),
}
Expand Down Expand Up @@ -818,9 +818,9 @@ func (b *executorBuilder) buildHashJoin(v *plan.PhysicalHashJoin) Executor {
defaultValues = make([]types.Datum, e.innerExec.Schema().Len())
}
}
e.resultGenerators = make([]joinResultGenerator, e.concurrency)
e.resultGenerators = make([]recordJoiner, e.concurrency)
for i := uint(0); i < e.concurrency; i++ {
e.resultGenerators[i] = newJoinResultGenerator(b.ctx, v.JoinType, v.InnerChildIdx == 0, defaultValues,
e.resultGenerators[i] = newRecordJoiner(b.ctx, v.JoinType, v.InnerChildIdx == 0, defaultValues,
v.OtherConditions, lhsTypes, rhsTypes)
}
metrics.ExecutorCounter.WithLabelValues("HashJoinExec").Inc()
Expand Down Expand Up @@ -1153,7 +1153,7 @@ func (b *executorBuilder) buildApply(apply *plan.PhysicalApply) *NestedLoopApply
if defaultValues == nil {
defaultValues = make([]types.Datum, v.Children()[v.InnerChildIdx].Schema().Len())
}
generator := newJoinResultGenerator(b.ctx, v.JoinType, v.InnerChildIdx == 0,
generator := newRecordJoiner(b.ctx, v.JoinType, v.InnerChildIdx == 0,
defaultValues, otherConditions, leftChild.retTypes(), rightChild.retTypes())
outerExec, innerExec := leftChild, rightChild
outerFilter, innerFilter := v.LeftConditions, v.RightConditions
Expand Down Expand Up @@ -1510,7 +1510,7 @@ func (b *executorBuilder) buildIndexLookUpJoin(v *plan.PhysicalIndexJoin) Execut
rowTypes: innerTypes,
},
workerWg: new(sync.WaitGroup),
resultGenerator: newJoinResultGenerator(b.ctx, v.JoinType, v.OuterIndex == 1, defaultValues, v.OtherConditions, leftTypes, rightTypes),
resultGenerator: newRecordJoiner(b.ctx, v.JoinType, v.OuterIndex == 1, defaultValues, v.OtherConditions, leftTypes, rightTypes),
indexRanges: v.Ranges,
keyOff2IdxOff: v.KeyOff2IdxOff,
}
Expand Down
2 changes: 1 addition & 1 deletion executor/index_lookup_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type IndexLookUpJoin struct {
joinResult *chunk.Chunk
innerIter chunk.Iterator

resultGenerator joinResultGenerator
resultGenerator recordJoiner

indexRanges []*ranger.Range
keyOff2IdxOff []int
Expand Down
6 changes: 3 additions & 3 deletions executor/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ type HashJoinExec struct {
innerIdx int

// We build individual resultGenerator for each join worker when use chunk-based execution,
// to avoid the concurrency of joinResultGenerator.chk and joinResultGenerator.selected.
resultGenerators []joinResultGenerator
// to avoid the concurrency of recordJoiner.chk and recordJoiner.selected.
resultGenerators []recordJoiner

outerKeyColIdx []int
innerKeyColIdx []int
Expand Down Expand Up @@ -562,7 +562,7 @@ type NestedLoopApplyExec struct {
outerFilter expression.CNFExprs
outer bool

resultGenerator joinResultGenerator
resultGenerator recordJoiner

outerSchema []*expression.CorrelatedColumn

Expand Down
Loading

0 comments on commit 6b74d45

Please sign in to comment.