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

planner: refine mppTask as capital one for latter pkg move #52491

Merged
merged 3 commits into from
Apr 11, 2024
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
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