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

executor: fix bug of tiflash executing apply (#19182) #5

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 executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,7 @@ func buildNoRangeTableReader(b *executorBuilder, v *plannercore.PhysicalTableRea
corColInFilter: b.corColInDistPlan(v.TablePlans),
corColInAccess: b.corColInAccess(v.TablePlans[0]),
plans: v.TablePlans,
tablePlan: v.GetTablePlan(),
storeType: v.StoreType,
}
e.setBatchCop(v)
Expand Down
15 changes: 12 additions & 3 deletions executor/table_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type TableReaderExecutor struct {
resultHandler *tableResultHandler
feedback *statistics.QueryFeedback
plans []plannercore.PhysicalPlan
tablePlan plannercore.PhysicalPlan

memTracker *memory.Tracker
selectResultHook // for testing
Expand Down Expand Up @@ -105,9 +106,17 @@ func (e *TableReaderExecutor) Open(ctx context.Context) error {

var err error
if e.corColInFilter {
e.dagPB.Executors, _, err = constructDistExec(e.ctx, e.plans)
if err != nil {
return err
if e.storeType == kv.TiFlash {
execs, _, err := constructDistExecForTiFlash(e.ctx, e.tablePlan)
if err != nil {
return err
}
e.dagPB.RootExecutor = execs[0]
} else {
e.dagPB.Executors, _, err = constructDistExec(e.ctx, e.plans)
if err != nil {
return err
}
}
}
if e.runtimeStats != nil {
Expand Down