Skip to content

Commit a258051

Browse files
committed
refactor: Move optimizer into planner
Signed-off-by: Xuanwo <github@xuanwo.io>
1 parent 1d0b42a commit a258051

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+37
-52
lines changed

src/query/service/src/sql/common/mod.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/query/service/src/sql/executor/expression_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use common_exception::Result;
1919
use common_legacy_planners::Expression;
2020

2121
use crate::sql::executor::util::format_field_name;
22+
use crate::sql::planner::IndexType;
2223
use crate::sql::plans::AggregateFunction;
2324
use crate::sql::plans::AndExpr;
2425
use crate::sql::plans::BoundColumnRef;
@@ -28,7 +29,6 @@ use crate::sql::plans::ConstantExpr;
2829
use crate::sql::plans::FunctionCall;
2930
use crate::sql::plans::OrExpr;
3031
use crate::sql::plans::Scalar;
31-
use crate::sql::IndexType;
3232
use crate::sql::MetadataRef;
3333

3434
pub trait FiledNameFormat {

src/query/service/src/sql/executor/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use super::Project;
3030
use super::Sort;
3131
use super::TableScan;
3232
use super::UnionAll;
33-
use crate::sql::IndexType;
33+
use crate::sql::planner::IndexType;
3434
use crate::sql::MetadataRef;
3535
use crate::sql::DUMMY_TABLE_INDEX;
3636

src/query/service/src/sql/executor/physical_plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ use super::physical_scalar::PhysicalScalar;
3333
use super::AggregateFunctionDesc;
3434
use super::SortDesc;
3535
use crate::sql::optimizer::ColumnSet;
36+
use crate::sql::planner::IndexType;
3637
use crate::sql::plans::JoinType;
3738
use crate::sql::ColumnBinding;
38-
use crate::sql::IndexType;
3939

4040
pub type ColumnID = String;
4141

src/query/service/src/sql/executor/physical_scalar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use common_datavalues::DataValue;
1818
use common_exception::Result;
1919

2020
use super::ColumnID;
21-
use crate::sql::IndexType;
21+
use crate::sql::planner::IndexType;
2222
use crate::sql::MetadataRef;
2323

2424
/// Serializable and desugared representation of `Scalar`.

src/query/service/src/sql/executor/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use once_cell::sync::Lazy;
1818
use regex::Regex;
1919

2020
use crate::sql::optimizer::SExpr;
21+
use crate::sql::planner::IndexType;
2122
use crate::sql::plans::Operator;
22-
use crate::sql::IndexType;
2323

2424
/// Check if all plans in an expression are physical plans
2525
pub fn check_physical(expression: &SExpr) -> bool {

src/query/service/src/sql/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
mod common;
1615
pub mod executor;
1716
mod metrics;
18-
pub mod optimizer;
1917
mod parsers;
2018
mod plan_parser;
2119
pub mod planner;
2220
mod sql_parser;
2321
mod sql_statement;
2422
pub mod statements;
25-
pub use common::*;
2623
use common_legacy_parser::sql_common;
2724
use common_storages_util::table_option_keys;
2825
pub use plan_parser::PlanParser;

src/query/service/src/sql/planner/binder/bind_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ use common_exception::Result;
2828
use parking_lot::RwLock;
2929

3030
use super::AggregateInfo;
31-
use crate::sql::common::IndexType;
3231
use crate::sql::normalize_identifier;
3332
use crate::sql::optimizer::SExpr;
33+
use crate::sql::planner::IndexType;
3434
use crate::sql::plans::Scalar;
3535
use crate::sql::NameResolutionContext;
3636

src/query/service/src/sql/planner/binder/distinct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ use crate::sql::binder::Binder;
2020
use crate::sql::binder::ColumnBinding;
2121
use crate::sql::optimizer::SExpr;
2222
use crate::sql::planner::semantic::GroupingChecker;
23+
use crate::sql::planner::IndexType;
2324
use crate::sql::plans::Aggregate;
2425
use crate::sql::plans::AggregateMode;
2526
use crate::sql::plans::BoundColumnRef;
2627
use crate::sql::plans::EvalScalar;
2728
use crate::sql::plans::Scalar;
2829
use crate::sql::plans::ScalarItem;
2930
use crate::sql::BindContext;
30-
use crate::sql::IndexType;
3131

3232
impl Binder {
3333
pub(super) fn bind_distinct(

src/query/service/src/sql/planner/binder/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use crate::sql::planner::binder::Binder;
3131
use crate::sql::planner::binder::ColumnBinding;
3232
use crate::sql::planner::semantic::normalize_identifier;
3333
use crate::sql::planner::semantic::GroupingChecker;
34+
use crate::sql::planner::IndexType;
3435
use crate::sql::plans::BoundColumnRef;
3536
use crate::sql::plans::EvalScalar;
3637
use crate::sql::plans::Project;
@@ -39,7 +40,6 @@ use crate::sql::plans::ScalarExpr;
3940
use crate::sql::plans::ScalarItem;
4041
use crate::sql::plans::SubqueryExpr;
4142
use crate::sql::plans::SubqueryType;
42-
use crate::sql::IndexType;
4343

4444
impl<'a> Binder {
4545
pub(super) fn analyze_projection(

0 commit comments

Comments
 (0)