Skip to content

Commit

Permalink
planner: refine mppTask as capital one for latter pkg move (pingcap#5…
Browse files Browse the repository at this point in the history
  • Loading branch information
AilinKid authored and 3AceShowHand committed Apr 16, 2024
1 parent f75b1dd commit a1ac4bb
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 154 deletions.
14 changes: 7 additions & 7 deletions pkg/planner/core/find_best_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (p *baseLogicalPlan) enumeratePhysicalPlans4Task(
}

// Optimize by shuffle executor to running in parallel manner.
if _, isMpp := curTask.(*mppTask); !isMpp && prop.IsSortItemEmpty() {
if _, isMpp := curTask.(*MppTask); !isMpp && prop.IsSortItemEmpty() {
// Currently, we do not regard shuffled plan as a new plan.
curTask = optimizeByShuffle(curTask, p.Plan.SCtx())
}
Expand Down Expand Up @@ -357,7 +357,7 @@ func (p *LogicalSequence) iterateChildPlan(
if childTask != nil && childTask.Invalid() {
return nil, 0, nil, nil
}
_, isMpp := childTask.(*mppTask)
_, isMpp := childTask.(*MppTask)
if !isMpp && prop.IsFlashProp() {
break
}
Expand All @@ -382,7 +382,7 @@ func (p *LogicalSequence) iterateChildPlan(
return nil, 0, nil, nil
}

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

Expand Down Expand Up @@ -472,7 +472,7 @@ func getTaskPlanCost(t Task, pop *coreusage.PhysicalOptimizeOp) (float64, bool,
indexPartialCost += partialCost
}
}
case *mppTask:
case *MppTask:
taskType = property.MppTaskType
default:
return 0, false, errors.New("unknown task type")
Expand Down Expand Up @@ -2443,7 +2443,7 @@ func (ds *DataSource) convertToTableScan(prop *property.PhysicalProperty, candid
return invalidTask, nil
}
// ********************************** future deprecated end **************************/
mppTask := &mppTask{
mppTask := &MppTask{
p: ts,
partTp: property.AnyType,
tblColHists: ds.TblColHists,
Expand Down Expand Up @@ -2695,7 +2695,7 @@ func (ds *DataSource) convertToBatchPointGet(prop *property.PhysicalProperty, ca
return rTsk
}

func (ts *PhysicalTableScan) addPushedDownSelectionToMppTask(mpp *mppTask, stats *property.StatsInfo) *mppTask {
func (ts *PhysicalTableScan) addPushedDownSelectionToMppTask(mpp *MppTask, stats *property.StatsInfo) *MppTask {
filterCondition, rootTaskConds := SplitSelCondsWithVirtualColumn(ts.filterCondition)
var newRootConds []expression.Expression
filterCondition, newRootConds = expression.PushDownExprs(GetPushDownCtx(ts.SCtx()), filterCondition, ts.StoreType)
Expand Down Expand Up @@ -2852,7 +2852,7 @@ func (p *LogicalCTE) findBestTask(prop *property.PhysicalProperty, counter *Plan
if prop.MPPPartitionTp != property.AnyType {
return invalidTask, 1, nil
}
t = &mppTask{
t = &MppTask{
p: pcte,
partTp: prop.MPPPartitionTp,
hashCols: prop.MPPPartitionCols,
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func AsSctx(pctx PlanContext) (sessionctx.Context, error) {

func enforceProperty(p *property.PhysicalProperty, tsk Task, ctx PlanContext) Task {
if p.TaskTp == property.MppTaskType {
mpp, ok := tsk.(*mppTask)
mpp, ok := tsk.(*MppTask)
if !ok || mpp.Invalid() {
return invalidTask
}
Expand Down
Loading

0 comments on commit a1ac4bb

Please sign in to comment.