Skip to content

Commit 66a6d4c

Browse files
authored
planner: refine mppTask as capital one for latter pkg move (#52491)
ref #52181
1 parent 87b8d01 commit 66a6d4c

File tree

4 files changed

+162
-154
lines changed

4 files changed

+162
-154
lines changed

pkg/planner/core/find_best_task.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func (p *baseLogicalPlan) enumeratePhysicalPlans4Task(
276276
}
277277

278278
// Optimize by shuffle executor to running in parallel manner.
279-
if _, isMpp := curTask.(*mppTask); !isMpp && prop.IsSortItemEmpty() {
279+
if _, isMpp := curTask.(*MppTask); !isMpp && prop.IsSortItemEmpty() {
280280
// Currently, we do not regard shuffled plan as a new plan.
281281
curTask = optimizeByShuffle(curTask, p.Plan.SCtx())
282282
}
@@ -357,7 +357,7 @@ func (p *LogicalSequence) iterateChildPlan(
357357
if childTask != nil && childTask.Invalid() {
358358
return nil, 0, nil, nil
359359
}
360-
_, isMpp := childTask.(*mppTask)
360+
_, isMpp := childTask.(*MppTask)
361361
if !isMpp && prop.IsFlashProp() {
362362
break
363363
}
@@ -382,7 +382,7 @@ func (p *LogicalSequence) iterateChildPlan(
382382
return nil, 0, nil, nil
383383
}
384384

385-
if _, ok := lastChildTask.(*mppTask); !ok && lastChildProp.CTEProducerStatus == property.AllCTECanMpp {
385+
if _, ok := lastChildTask.(*MppTask); !ok && lastChildProp.CTEProducerStatus == property.AllCTECanMpp {
386386
return nil, 0, nil, nil
387387
}
388388

@@ -472,7 +472,7 @@ func getTaskPlanCost(t Task, pop *coreusage.PhysicalOptimizeOp) (float64, bool,
472472
indexPartialCost += partialCost
473473
}
474474
}
475-
case *mppTask:
475+
case *MppTask:
476476
taskType = property.MppTaskType
477477
default:
478478
return 0, false, errors.New("unknown task type")
@@ -2443,7 +2443,7 @@ func (ds *DataSource) convertToTableScan(prop *property.PhysicalProperty, candid
24432443
return invalidTask, nil
24442444
}
24452445
// ********************************** future deprecated end **************************/
2446-
mppTask := &mppTask{
2446+
mppTask := &MppTask{
24472447
p: ts,
24482448
partTp: property.AnyType,
24492449
tblColHists: ds.TblColHists,
@@ -2695,7 +2695,7 @@ func (ds *DataSource) convertToBatchPointGet(prop *property.PhysicalProperty, ca
26952695
return rTsk
26962696
}
26972697

2698-
func (ts *PhysicalTableScan) addPushedDownSelectionToMppTask(mpp *mppTask, stats *property.StatsInfo) *mppTask {
2698+
func (ts *PhysicalTableScan) addPushedDownSelectionToMppTask(mpp *MppTask, stats *property.StatsInfo) *MppTask {
26992699
filterCondition, rootTaskConds := SplitSelCondsWithVirtualColumn(ts.filterCondition)
27002700
var newRootConds []expression.Expression
27012701
filterCondition, newRootConds = expression.PushDownExprs(GetPushDownCtx(ts.SCtx()), filterCondition, ts.StoreType)
@@ -2852,7 +2852,7 @@ func (p *LogicalCTE) findBestTask(prop *property.PhysicalProperty, counter *Plan
28522852
if prop.MPPPartitionTp != property.AnyType {
28532853
return invalidTask, 1, nil
28542854
}
2855-
t = &mppTask{
2855+
t = &MppTask{
28562856
p: pcte,
28572857
partTp: prop.MPPPartitionTp,
28582858
hashCols: prop.MPPPartitionCols,

pkg/planner/core/plan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func AsSctx(pctx PlanContext) (sessionctx.Context, error) {
5151

5252
func enforceProperty(p *property.PhysicalProperty, tsk Task, ctx PlanContext) Task {
5353
if p.TaskTp == property.MppTaskType {
54-
mpp, ok := tsk.(*mppTask)
54+
mpp, ok := tsk.(*MppTask)
5555
if !ok || mpp.Invalid() {
5656
return invalidTask
5757
}

0 commit comments

Comments
 (0)