Skip to content

Commit 865b150

Browse files
authored
chore(optimizer): add rule/push_down_filter_join unit test (#17676)
* chore(optimizer): rule/push_down_filter_join unit test * fix clippy warning
1 parent ba2d1d3 commit 865b150

File tree

9 files changed

+1467
-4
lines changed

9 files changed

+1467
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/query/sql/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,8 @@ tokio = { workspace = true }
7272
unicase = { workspace = true }
7373
url = { workspace = true }
7474

75+
[dev-dependencies]
76+
pretty_assertions = { workspace = true }
77+
7578
[lints]
7679
workspace = true

src/query/sql/src/planner/optimizer/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod memo;
2828
#[allow(clippy::module_inception)]
2929
mod optimizer;
3030
mod property;
31-
mod rule;
31+
pub mod rule;
3232
pub mod s_expr;
3333
mod statistics;
3434
mod util;
@@ -51,7 +51,6 @@ pub use optimizer::OptimizerContext;
5151
pub use optimizer::RecursiveOptimizer;
5252
pub use property::*;
5353
pub use rule::agg_index;
54-
pub use rule::try_push_down_filter_join;
5554
pub use rule::RuleFactory;
5655
pub use rule::RuleID;
5756
pub use rule::RuleSet;

src/query/sql/src/planner/optimizer/rule/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod utils;
2323

2424
pub use factory::RuleFactory;
2525
pub use rewrite::agg_index;
26-
pub use rewrite::try_push_down_filter_join;
26+
pub use rewrite::RulePushDownFilterJoin;
2727
pub use rule::Rule;
2828
pub use rule::RuleID;
2929
pub use rule::RulePtr;

src/query/sql/src/planner/optimizer/rule/rewrite/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ pub use rule_merge_filter_into_mutation::RuleMergeFilterIntoMutation;
6262
pub use rule_normalize_scalar::RuleNormalizeScalarFilter;
6363
pub use rule_push_down_filter_aggregate::RulePushDownFilterAggregate;
6464
pub use rule_push_down_filter_eval_scalar::RulePushDownFilterEvalScalar;
65-
pub use rule_push_down_filter_join::try_push_down_filter_join;
6665
pub use rule_push_down_filter_join::RulePushDownFilterJoin;
6766
pub use rule_push_down_filter_project_set::RulePushDownFilterProjectSet;
6867
pub use rule_push_down_filter_scan::RulePushDownFilterScan;

src/query/sql/tests/optimizer/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414

1515
mod filter;
1616
mod histogram;
17+
mod rule;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2021 Datafuse Labs
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
mod push_down_filter_join_test;

0 commit comments

Comments
 (0)