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

*: change package name from plan to planner #7760

Merged
merged 12 commits into from
Sep 25, 2018

Conversation

zz-jason
Copy link
Member

What problem does this PR solve?

This PR makes the following two package changes:

  1. change the "plan" package to "planner"
  2. move all the source files inside the "planner" package to the "planner/core" package

The propose of this PR is to:

  1. modularize the "planner" package
  2. prevent the chaos to implement the cascades planner.

What is changed and how it works?

almost all the code changes are made by the shell scripts

Check List

Tests

  • Unit test
  • Integration test

@zz-jason
Copy link
Member Author

/run-all-tests

@zz-jason zz-jason added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Sep 21, 2018
@zz-jason
Copy link
Member Author

@winoros @eurekaka @XuHuaiyu PTAL

@jackysp
Copy link
Member

jackysp commented Sep 21, 2018

Please update the PR title.

@winoros winoros changed the title Dev/plan changeto planner *: change package name from plan to planner Sep 21, 2018
Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There're some unnecessary changes.

@zz-jason zz-jason added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Sep 21, 2018
Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please fix the CI

@@ -1738,27 +1738,27 @@ func (b *executorBuilder) buildIndexLookUpReader(v *plan.PhysicalIndexLookUpRead
// dataReaderBuilder build an executor.
// The executor can be used to read data in the ranges which are constructed by datums.
// Differences from executorBuilder:
// 1. dataReaderBuilder calculate data range from argument, rather than plan.
// 1. dataReaderBuilder calculate data range from argument, rather than core.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false positive

@@ -1821,7 +1821,7 @@ func (builder *dataReaderBuilder) buildIndexLookUpReaderForIndexJoin(ctx context
return e, errors.Trace(err)
}

// buildKvRangesForIndexJoin builds kv ranges for index join when the inner plan is index scan plan.
// buildKvRangesForIndexJoin builds kv ranges for index join when the inner plan is index scan core.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -103,7 +103,7 @@ type UnionScanExec struct {
conditions []expression.Expression
columns []*model.ColumnInfo

// belowHandleIndex is the handle's position of the below scan plan.
// belowHandleIndex is the handle's position of the below scan planner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -66,7 +66,7 @@ func ExpressionsToPB(sc *stmtctx.StatementContext, exprs []Expression, client kv
return
}

// ExpressionsToPBList converts expressions to tipb.Expr list for new plan.
// ExpressionsToPBList converts expressions to tipb.Expr list for new planner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -102,14 +102,14 @@ type ChecksumTable struct {
Tables []*ast.TableName
}

// CancelDDLJobs represents a cancel DDL jobs plan.
// CancelDDLJobs represents a cancel DDL jobs planner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -43,7 +43,7 @@ type copTask struct {
indexPlan PhysicalPlan
tablePlan PhysicalPlan
cst float64
// indexPlanFinished means we have finished index plan.
// indexPlanFinished means we have finished index planner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

// If all columns in topN are from index plan, we can push it to index plan. Or we finish the index plan and
// push it to table plan.
// If all columns in topN are from index plan, we can push it to index planner. Or we finish the index plan and
// push it to table planner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto


import (
"github.com/pingcap/tidb/ast"
)

// Trace represents a trace plan.
// Trace represents a trace planner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

PlanID int

// PlanColumnID is the unique id for column when building plan.
// PlanColumnID is the unique id for column when building planner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -20,7 +20,7 @@ import (
"github.com/pingcap/tidb/types"
)

// conditionChecker checks if this condition can be pushed to index plan.
// conditionChecker checks if this condition can be pushed to index planner.
type conditionChecker struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@zz-jason
Copy link
Member Author

/run-all-tests

@@ -155,11 +155,11 @@ func (a *ExecStmt) IsPrepared() bool {

// IsReadOnly returns true if a statement is read only.
// It will update readOnlyCheckStmt if current ExecStmt can be conveted to
// a plan.Execute. Last step is using ast.IsReadOnly function to determine
// a core.Execute. Last step is using ast.IsReadOnly function to determine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it used outside the planner package. What about import it as plancore when its outside the planner package?

@zz-jason
Copy link
Member Author

/run-all-tests

@zz-jason
Copy link
Member Author

/run-unit-test
/run-integration-ddl-test tidb-test=pr/628

@zz-jason
Copy link
Member Author

@winoros @eurekaka comments addressed and all the tests are passed, PTAL

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lysu lysu added the status/LGT2 Indicates that a PR has LGTM 2. label Sep 21, 2018
@shenli
Copy link
Member

shenli commented Sep 23, 2018

@zz-jason Please resolve the conflicts.

@zz-jason
Copy link
Member Author

/run-all-tests

@zz-jason
Copy link
Member Author

/run-integration-ddl-test

@zz-jason
Copy link
Member Author

/run-integration-ddl-test tidb-test=pr/628

@eurekaka
Copy link
Contributor

LGTM

@zz-jason
Copy link
Member Author

@XuHuaiyu @shenli PTAL

@eurekaka eurekaka merged commit e79bd94 into pingcap:master Sep 25, 2018
@zz-jason zz-jason deleted the dev/plan-changeto-planner branch September 25, 2018 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This issue blocks a release. Please solve it ASAP. sig/planner SIG: Planner status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants