Skip to content

Commit

Permalink
save work
Browse files Browse the repository at this point in the history
Signed-off-by: xufei <[email protected]>
  • Loading branch information
windtalker committed Nov 19, 2024
1 parent 35d5739 commit d97c5d3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions pkg/executor/join/hash_join_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,6 @@ func (b *BuildWorkerV2) splitPartitionAndAppendToRowTableForRestore(inDisk *chun
}
}()

partitionNumber := b.HashJoinCtx.partitionNumber
hashJoinCtx := b.HashJoinCtx

b.builder = createRowTableBuilder(b.BuildKeyColIdx, hashJoinCtx.BuildKeyTypes, partitionNumber, b.HasNullableKey, hashJoinCtx.BuildFilter != nil, hashJoinCtx.needScanRowTableAfterProbeDone)

hasErr := false
chunkNum := inDisk.NumChunks()
for i := 0; i < chunkNum; i++ {
Expand Down Expand Up @@ -544,10 +539,6 @@ func (b *BuildWorkerV2) splitPartitionAndAppendToRowTable(typeCtx types.Context,
setMaxValue(&b.HashJoinCtx.stats.maxPartitionData, cost)
}
}()
partitionNumber := b.HashJoinCtx.partitionNumber
hashJoinCtx := b.HashJoinCtx

b.builder = createRowTableBuilder(b.BuildKeyColIdx, hashJoinCtx.BuildKeyTypes, partitionNumber, b.HasNullableKey, hashJoinCtx.BuildFilter != nil, hashJoinCtx.needScanRowTableAfterProbeDone)

hasErr := false
for chk := range srcChkCh {
Expand Down Expand Up @@ -1263,6 +1254,11 @@ func (e *HashJoinV2Exec) fetchAndBuildHashTableImpl(ctx context.Context) {

// doneCh is used by the consumer(splitAndAppendToRowTable) to info the producer(fetchBuildSideRows) that the consumer meet error and stop consume data
doneCh := make(chan struct{}, e.Concurrency)
// init builder
hashJoinCtx := e.HashJoinCtxV2
for _, worker := range e.BuildWorkers {
worker.builder = createRowTableBuilder(worker.BuildKeyColIdx, hashJoinCtx.BuildKeyTypes, hashJoinCtx.partitionNumber, worker.HasNullableKey, hashJoinCtx.BuildFilter != nil, hashJoinCtx.needScanRowTableAfterProbeDone)
}
srcChkCh, waitForController := e.fetchBuildSideRows(ctx, fetcherAndWorkerSyncer, wg, errCh, doneCh)
e.splitAndAppendToRowTable(srcChkCh, waitForController, fetcherAndWorkerSyncer, wg, errCh, doneCh)
success := waitJobDone(wg, errCh)
Expand Down

0 comments on commit d97c5d3

Please sign in to comment.