Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
Signed-off-by: AilinKid <314806019@qq.com>
  • Loading branch information
AilinKid committed Apr 17, 2024
1 parent 2a55b71 commit 623e497
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion pkg/planner/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ go_library(
"//pkg/planner/context",
"//pkg/planner/core/base",
"//pkg/planner/core/metrics",
"//pkg/planner/core/operator/baseImpl",
"//pkg/planner/core/operator/baseimpl",
"//pkg/planner/funcdep",
"//pkg/planner/property",
"//pkg/planner/util",
Expand Down
24 changes: 12 additions & 12 deletions pkg/planner/core/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/kv"
"github.com/pingcap/tidb/pkg/planner/core/base"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseImpl"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseimpl"
"github.com/pingcap/tidb/pkg/planner/property"
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util/plancodec"
Expand Down Expand Up @@ -236,31 +236,31 @@ func (p PhysicalShuffleReceiverStub) Init(ctx base.PlanContext, stats *property.

// Init initializes Update.
func (p Update) Init(ctx base.PlanContext) *Update {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeUpdate, 0)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeUpdate, 0)
return &p
}

// Init initializes Delete.
func (p Delete) Init(ctx base.PlanContext) *Delete {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeDelete, 0)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeDelete, 0)
return &p
}

// Init initializes Insert.
func (p Insert) Init(ctx base.PlanContext) *Insert {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeInsert, 0)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeInsert, 0)
return &p
}

// Init initializes LoadData.
func (p LoadData) Init(ctx base.PlanContext) *LoadData {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeLoadData, 0)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeLoadData, 0)
return &p
}

// Init initializes ImportInto.
func (p ImportInto) Init(ctx base.PlanContext) *ImportInto {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeImportInto, 0)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeImportInto, 0)
return &p
}

Expand Down Expand Up @@ -543,7 +543,7 @@ func (p PhysicalIndexHashJoin) Init(ctx base.PlanContext) *PhysicalIndexHashJoin

// Init initializes BatchPointGetPlan.
func (p *BatchPointGetPlan) Init(ctx base.PlanContext, stats *property.StatsInfo, schema *expression.Schema, names []*types.FieldName, offset int) *BatchPointGetPlan {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeBatchPointGet, offset)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeBatchPointGet, offset)
p.schema = schema
p.names = names
p.SetStats(stats)
Expand All @@ -554,22 +554,22 @@ func (p *BatchPointGetPlan) Init(ctx base.PlanContext, stats *property.StatsInfo

// Init initializes PointGetPlan.
func (p PointGetPlan) Init(ctx base.PlanContext, stats *property.StatsInfo, offset int, _ ...*property.PhysicalProperty) *PointGetPlan {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypePointGet, offset)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypePointGet, offset)
p.SetStats(stats)
p.Columns = ExpandVirtualColumn(p.Columns, p.schema, p.TblInfo.Columns)
return &p
}

// Init only assigns type and context.
func (p PhysicalExchangeSender) Init(ctx base.PlanContext, stats *property.StatsInfo) *PhysicalExchangeSender {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeExchangeSender, 0)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeExchangeSender, 0)
p.SetStats(stats)
return &p
}

// Init only assigns type and context.
func (p PhysicalExchangeReceiver) Init(ctx base.PlanContext, stats *property.StatsInfo) *PhysicalExchangeReceiver {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeExchangeReceiver, 0)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeExchangeReceiver, 0)
p.SetStats(stats)
return &p
}
Expand Down Expand Up @@ -614,7 +614,7 @@ func (p LogicalCTETable) Init(ctx base.PlanContext, offset int) *LogicalCTETable

// Init only assigns type and context.
func (p PhysicalCTETable) Init(ctx base.PlanContext, stats *property.StatsInfo) *PhysicalCTETable {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeCTETable, 0)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeCTETable, 0)
p.SetStats(stats)
return &p
}
Expand Down Expand Up @@ -649,6 +649,6 @@ func (p PhysicalSequence) Init(ctx base.PlanContext, stats *property.StatsInfo,

// Init initializes ScalarSubqueryEvalCtx
func (p ScalarSubqueryEvalCtx) Init(ctx base.PlanContext, offset int) *ScalarSubqueryEvalCtx {
p.Plan = baseImpl.NewBasePlan(ctx, plancodec.TypeScalarSubQuery, offset)
p.Plan = baseimpl.NewBasePlan(ctx, plancodec.TypeScalarSubQuery, offset)
return &p
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "baseImpl",
name = "baseimpl",
srcs = ["plan.go"],
importpath = "github.com/pingcap/tidb/pkg/planner/core/operator/baseImpl",
importpath = "github.com/pingcap/tidb/pkg/planner/core/operator/baseimpl",
visibility = ["//visibility:public"],
deps = [
"//pkg/expression",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package baseImpl
package baseimpl

import (
"fmt"
Expand Down
10 changes: 5 additions & 5 deletions pkg/planner/core/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/pingcap/tidb/pkg/kv"
"github.com/pingcap/tidb/pkg/planner/cardinality"
"github.com/pingcap/tidb/pkg/planner/core/base"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseImpl"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseimpl"
fd "github.com/pingcap/tidb/pkg/planner/funcdep"
"github.com/pingcap/tidb/pkg/planner/property"
"github.com/pingcap/tidb/pkg/planner/util"
Expand Down Expand Up @@ -311,7 +311,7 @@ type LogicalPlan interface {
}

type baseLogicalPlan struct {
baseImpl.Plan
baseimpl.Plan

taskMap map[string]base.Task
// taskMapBak forms a backlog stack of taskMap, used to roll back the taskMap.
Expand Down Expand Up @@ -386,7 +386,7 @@ func getActualProbeCntFromProbeParents(pps []base.PhysicalPlan, statsColl *execd
}

type basePhysicalPlan struct {
baseImpl.Plan
baseimpl.Plan

childrenReqProps []*property.PhysicalProperty
self base.PhysicalPlan
Expand Down Expand Up @@ -602,14 +602,14 @@ func newBaseLogicalPlan(ctx base.PlanContext, tp string, self LogicalPlan, qbOff
taskMap: make(map[string]base.Task),
taskMapBak: make([]string, 0, 10),
taskMapBakTS: make([]uint64, 0, 10),
Plan: baseImpl.NewBasePlan(ctx, tp, qbOffset),
Plan: baseimpl.NewBasePlan(ctx, tp, qbOffset),
self: self,
}
}

func newBasePhysicalPlan(ctx base.PlanContext, tp string, self base.PhysicalPlan, offset int) basePhysicalPlan {
return basePhysicalPlan{
Plan: baseImpl.NewBasePlan(ctx, tp, offset),
Plan: baseimpl.NewBasePlan(ctx, tp, offset),
self: self,
}
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/planner/core/point_get_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/pingcap/tidb/pkg/parser/terror"
ptypes "github.com/pingcap/tidb/pkg/parser/types"
"github.com/pingcap/tidb/pkg/planner/core/base"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseImpl"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseimpl"
"github.com/pingcap/tidb/pkg/planner/property"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/privilege"
Expand Down Expand Up @@ -69,7 +69,7 @@ const GlobalWithoutColumnPos = -1
// When we detect that the statement has a unique equal access condition, this plan is used.
// This plan is much faster to build and to execute because it avoids the optimization and coprocessor cost.
type PointGetPlan struct {
baseImpl.Plan
baseimpl.Plan
dbName string
schema *expression.Schema
TblInfo *model.TableInfo
Expand Down Expand Up @@ -1478,7 +1478,7 @@ func indexIsAvailableByHints(idxInfo *model.IndexInfo, idxHints []*ast.IndexHint

func newPointGetPlan(ctx base.PlanContext, dbName string, schema *expression.Schema, tbl *model.TableInfo, names []*types.FieldName) *PointGetPlan {
p := &PointGetPlan{
Plan: baseImpl.NewBasePlan(ctx, plancodec.TypePointGet, 0),
Plan: baseimpl.NewBasePlan(ctx, plancodec.TypePointGet, 0),
dbName: dbName,
schema: schema,
TblInfo: tbl,
Expand Down
4 changes: 2 additions & 2 deletions pkg/planner/core/scalar_subq_expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import (
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/infoschema"
"github.com/pingcap/tidb/pkg/planner/core/base"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseImpl"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseimpl"
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util/chunk"
"github.com/pingcap/tidb/pkg/util/codec"
)

// ScalarSubqueryEvalCtx store the plan for the subquery, used by ScalarSubQueryExpr.
type ScalarSubqueryEvalCtx struct {
baseImpl.Plan
baseimpl.Plan

// The context for evaluating the subquery.
scalarSubQuery base.PhysicalPlan
Expand Down
4 changes: 2 additions & 2 deletions pkg/planner/core/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/planner/cardinality"
"github.com/pingcap/tidb/pkg/planner/core/base"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseImpl"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseimpl"
"github.com/pingcap/tidb/pkg/planner/property"
"github.com/pingcap/tidb/pkg/planner/util"
"github.com/pingcap/tidb/pkg/types"
Expand Down Expand Up @@ -1986,7 +1986,7 @@ func (p *PhysicalHashAgg) adjust3StagePhaseAgg(partialAgg, finalAgg base.Physica
}
cloneHashAgg := clonedAgg.(*PhysicalHashAgg)
// Clone(), it will share same base-plan elements from the finalAgg, including id,tp,stats. Make a new one here.
cloneHashAgg.Plan = baseImpl.NewBasePlan(cloneHashAgg.SCtx(), cloneHashAgg.TP(), cloneHashAgg.QueryBlockOffset())
cloneHashAgg.Plan = baseimpl.NewBasePlan(cloneHashAgg.SCtx(), cloneHashAgg.TP(), cloneHashAgg.QueryBlockOffset())
cloneHashAgg.SetStats(finalAgg.StatsInfo()) // reuse the final agg stats here.

// step1: adjust partial agg, for normal agg here, adjust it to target for specified group data.
Expand Down
4 changes: 2 additions & 2 deletions pkg/planner/core/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/planner/core/base"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseImpl"
"github.com/pingcap/tidb/pkg/planner/core/operator/baseimpl"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/sessionctx"
"github.com/pingcap/tidb/pkg/table"
Expand Down Expand Up @@ -200,7 +200,7 @@ func (s *physicalSchemaProducer) MemoryUsage() (sum int64) {
type baseSchemaProducer struct {
schema *expression.Schema
names types.NameSlice
baseImpl.Plan
baseimpl.Plan
}

// OutputNames returns the outputting names of each column.
Expand Down

0 comments on commit 623e497

Please sign in to comment.