From 476cdf673c1c3122c01b4d0014b16d9a8f0e1d54 Mon Sep 17 00:00:00 2001 From: liushengjie <251098199@qq.com> Date: Mon, 12 Aug 2024 19:48:08 +0800 Subject: [PATCH] planner: move `rule_constant_propagation` to rule pkg. (#55231) --- pkg/planner/core/BUILD.bazel | 1 - pkg/planner/core/optimizer.go | 2 +- pkg/planner/core/rule/BUILD.bazel | 1 + pkg/planner/core/{ => rule}/rule_constant_propagation.go | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename pkg/planner/core/{ => rule}/rule_constant_propagation.go (99%) diff --git a/pkg/planner/core/BUILD.bazel b/pkg/planner/core/BUILD.bazel index 86bffb8678eb9..4899ce0a774fd 100644 --- a/pkg/planner/core/BUILD.bazel +++ b/pkg/planner/core/BUILD.bazel @@ -67,7 +67,6 @@ go_library( "rule_aggregation_skew_rewrite.go", "rule_collect_plan_stats.go", "rule_column_pruning.go", - "rule_constant_propagation.go", "rule_decorrelate.go", "rule_derive_topn_from_window.go", "rule_eliminate_projection.go", diff --git a/pkg/planner/core/optimizer.go b/pkg/planner/core/optimizer.go index 2b312029c778e..b3be779246cd3 100644 --- a/pkg/planner/core/optimizer.go +++ b/pkg/planner/core/optimizer.go @@ -110,7 +110,7 @@ var optRuleList = []base.LogicalOptRule{ &SkewDistinctAggRewriter{}, &ProjectionEliminator{}, &MaxMinEliminator{}, - &ConstantPropagationSolver{}, + &rule.ConstantPropagationSolver{}, &ConvertOuterToInnerJoin{}, &PPDSolver{}, &OuterJoinEliminator{}, diff --git a/pkg/planner/core/rule/BUILD.bazel b/pkg/planner/core/rule/BUILD.bazel index 7c2175db74f8e..e37b3eaaf3852 100644 --- a/pkg/planner/core/rule/BUILD.bazel +++ b/pkg/planner/core/rule/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "rule", srcs = [ "rule_build_key_info.go", + "rule_constant_propagation.go", "rule_init.go", ], importpath = "github.com/pingcap/tidb/pkg/planner/core/rule", diff --git a/pkg/planner/core/rule_constant_propagation.go b/pkg/planner/core/rule/rule_constant_propagation.go similarity index 99% rename from pkg/planner/core/rule_constant_propagation.go rename to pkg/planner/core/rule/rule_constant_propagation.go index fb5273e49a530..a3c8c16e0821b 100644 --- a/pkg/planner/core/rule_constant_propagation.go +++ b/pkg/planner/core/rule/rule_constant_propagation.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package core +package rule import ( "context"