-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
- Loading branch information
1 parent
8e63752
commit becd3d4
Showing
8 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"rust-analyzer.linkedProjects": [ | ||
"./Cargo.toml" | ||
], | ||
"cSpell.words": [ | ||
"Subquery" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod error; | ||
pub mod parser; | ||
pub mod planner; | ||
pub mod types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use std::sync::Arc; | ||
|
||
use crate::parser::stmt::Statement; | ||
|
||
use super::logical_operation::LogicalPlan; | ||
|
||
pub struct BoundStatement { | ||
_names: Vec<String>, | ||
plan: Arc<LogicalPlan>, | ||
} | ||
|
||
pub struct Binder {} | ||
|
||
impl Binder { | ||
pub fn create_plan(stmt: Statement) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use core::fmt::Debug; | ||
|
||
use std::sync::Arc; | ||
|
||
use crate::parser::expression::Expression; | ||
|
||
#[derive(PartialEq, Debug, Clone)] | ||
pub enum LogicalPlan { | ||
Projection(Projection), | ||
Filter(Filter), | ||
Aggregate(Aggregate), | ||
Sort, | ||
Join, | ||
Statement, | ||
TableScan, | ||
Subquery, | ||
Limit, | ||
Values, | ||
Explain, | ||
Dml, | ||
Ddl, | ||
} | ||
|
||
/// Evaluates an arbitrary list of expressions (essentially a | ||
/// SELECT with an expression list) on its input. | ||
#[derive(PartialEq, Debug, Clone)] | ||
// mark non_exhaustive to encourage use of try_new/new() | ||
#[non_exhaustive] | ||
pub struct Projection { | ||
/// The list of expressions | ||
pub expr: Vec<Expression>, | ||
/// The incoming logical plan | ||
pub input: Arc<LogicalPlan>, | ||
/// The schema description of the output | ||
pub schema: Option<String>, | ||
} | ||
|
||
#[derive(PartialEq, Debug, Clone)] | ||
#[non_exhaustive] | ||
pub struct Filter { | ||
/// The predicate expression, which must have Boolean type. | ||
pub predicate: Expression, | ||
/// The incoming logical plan | ||
pub input: Box<LogicalPlan>, | ||
} | ||
|
||
#[derive(PartialEq, Debug, Clone)] | ||
#[non_exhaustive] | ||
pub(crate) struct Aggregate {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub mod binder; | ||
pub mod logical_operation; | ||
pub mod planner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::parser::stmt::Statement; | ||
|
||
use super::logical_operation::LogicalPlan; | ||
|
||
pub struct Planner { | ||
logic_plan: Option<LogicalPlan>, | ||
} | ||
|
||
impl Planner { | ||
pub fn create_plan(&mut self, _stmt: Statement) { | ||
self.logic_plan = None; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|