Skip to content

Commit ec2f438

Browse files
committed
Move ListPlan
Signed-off-by: Xuanwo <github@xuanwo.io>
1 parent 0f89f6b commit ec2f438

File tree

8 files changed

+11
-25
lines changed

8 files changed

+11
-25
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/legacy-planners/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ mod plan_having;
3535
mod plan_insert_into;
3636
mod plan_limit;
3737
mod plan_limit_by;
38-
mod plan_list;
3938
mod plan_node;
4039
mod plan_node_builder;
4140
mod plan_node_display;
@@ -153,7 +152,6 @@ pub use plan_insert_into::InsertPlan;
153152
pub use plan_insert_into::InsertValueBlock;
154153
pub use plan_limit::LimitPlan;
155154
pub use plan_limit_by::LimitByPlan;
156-
pub use plan_list::ListPlan;
157155
pub use plan_node::PlanNode;
158156
pub use plan_node_builder::PlanBuilder;
159157
pub use plan_node_extras::Extras;

src/query/planner/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ edition = "2021"
1010
common-catalog = { path = "../catalog" }
1111
common-datavalues = { path = "../datavalues" }
1212
common-meta-app = {path = "../../meta/app"}
13+
common-meta-types = {path = "../../meta/types"}
1314

1415
parking_lot = "0.12"
1516
serde = { version = "1", features = ["derive"]}
Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Datafuse Labs.
1+
// Copyright 2022 Datafuse Labs.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -11,19 +11,12 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
15-
use std::fmt::Debug;
16-
use std::fmt::Formatter;
1714
use std::sync::Arc;
1815

19-
use common_datavalues::prelude::ToDataType;
2016
use common_datavalues::prelude::*;
21-
use common_datavalues::DataField;
22-
use common_datavalues::DataSchema;
23-
use common_datavalues::DataSchemaRef;
2417
use common_meta_types::UserStageInfo;
2518

26-
#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone)]
19+
#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Debug)]
2720
pub struct ListPlan {
2821
pub stage: UserStageInfo,
2922
pub path: String,
@@ -37,6 +30,7 @@ impl ListPlan {
3730
let md5 = DataField::new_nullable("md5", Vu8::to_data_type());
3831
let last_modified = DataField::new("last_modified", Vu8::to_data_type());
3932
let creator = DataField::new_nullable("creator", Vu8::to_data_type());
33+
4034
Arc::new(DataSchema::new(vec![
4135
name,
4236
size,
@@ -46,14 +40,3 @@ impl ListPlan {
4640
]))
4741
}
4842
}
49-
50-
impl Debug for ListPlan {
51-
// Ignore the schema.
52-
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
53-
write!(f, "List {:?}", self.stage)?;
54-
if !self.pattern.is_empty() {
55-
write!(f, " ,pattern:{:?}", self.pattern)?;
56-
}
57-
Ok(())
58-
}
59-
}

src/query/planner/src/plans/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ pub use drop_database::DropDatabasePlan;
2424
mod kill;
2525
pub use kill::KillPlan;
2626

27+
mod list;
28+
pub use list::ListPlan;
29+
2730
mod rename_database;
2831
pub use rename_database::RenameDatabaseEntity;
2932
pub use rename_database::RenameDatabasePlan;

src/query/service/src/interpreters/interpreter_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use common_datavalues::DataSchemaRef;
1919
use common_datavalues::Series;
2020
use common_datavalues::SeriesFrom;
2121
use common_exception::Result;
22-
use common_legacy_planners::ListPlan;
22+
use common_planner::plans::ListPlan;
2323

2424
use crate::interpreters::interpreter_common::list_files;
2525
use crate::interpreters::Interpreter;

src/query/service/src/sql/planner/binder/ddl/stage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ use common_ast::ast::CreateStageStmt;
1818
use common_exception::ErrorCode;
1919
use common_exception::Result;
2020
use common_legacy_planners::CreateUserStagePlan;
21-
use common_legacy_planners::ListPlan;
2221
use common_legacy_planners::RemoveUserStagePlan;
2322
use common_meta_types::OnErrorMode;
2423
use common_meta_types::StageType;
2524
use common_meta_types::UserStageInfo;
25+
use common_planner::plans::ListPlan;
2626
use common_storage::parse_uri_location;
2727
use common_storage::UriLocation;
2828

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ use common_legacy_planners::DropViewPlan;
6565
use common_legacy_planners::ExistsTablePlan;
6666
use common_legacy_planners::GrantPrivilegePlan;
6767
use common_legacy_planners::GrantRolePlan;
68-
use common_legacy_planners::ListPlan;
6968
use common_legacy_planners::OptimizeTablePlan;
7069
use common_legacy_planners::ReclusterTablePlan;
7170
use common_legacy_planners::RemoveUserStagePlan;
@@ -82,6 +81,7 @@ use common_planner::plans::CallPlan;
8281
use common_planner::plans::CreateDatabasePlan;
8382
use common_planner::plans::DropDatabasePlan;
8483
use common_planner::plans::KillPlan;
84+
use common_planner::plans::ListPlan;
8585
use common_planner::plans::RenameDatabasePlan;
8686
use common_planner::plans::ShowCreateDatabasePlan;
8787
use common_planner::plans::UndropDatabasePlan;

0 commit comments

Comments
 (0)