From 7e9f85320d7614047c8441256803bb5120622a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=8D=E7=99=BD?= <251098199@qq.com> Date: Tue, 13 Aug 2024 13:06:10 +0800 Subject: [PATCH] planner: move `rule_constant_propagation` to rule pkg. (#55231) (#55345) ref pingcap/tidb#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 3ea41de60ef5e..273e6ae569c11 100644 --- a/pkg/planner/core/BUILD.bazel +++ b/pkg/planner/core/BUILD.bazel @@ -66,7 +66,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"