-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor DmlStatement enum and its associated types
- Loading branch information
Showing
14 changed files
with
342 additions
and
86 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
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
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
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,37 @@ | ||
use std::sync::Arc; | ||
|
||
use crate::common::table_relation::TableRelation; | ||
use crate::error::Result; | ||
use crate::physical::plan::PhysicalPlan; | ||
use arrow::array::RecordBatch; | ||
use arrow::datatypes::SchemaRef; | ||
|
||
pub struct CreateTable { | ||
table: TableRelation, | ||
schema: SchemaRef, | ||
source: Arc<dyn PhysicalPlan>, | ||
} | ||
|
||
impl CreateTable { | ||
pub fn new(table: String, schema: SchemaRef, source: Arc<dyn PhysicalPlan>) -> Self { | ||
Self { | ||
table: table.into(), | ||
schema, | ||
source, | ||
} | ||
} | ||
} | ||
|
||
impl PhysicalPlan for CreateTable { | ||
fn schema(&self) -> SchemaRef { | ||
todo!() | ||
} | ||
|
||
fn execute(&self) -> Result<Vec<RecordBatch>> { | ||
todo!() | ||
} | ||
|
||
fn children(&self) -> Option<Vec<Arc<dyn PhysicalPlan>>> { | ||
todo!() | ||
} | ||
} |
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,26 @@ | ||
use crate::physical::plan::PhysicalPlan; | ||
|
||
pub struct DropTable { | ||
pub name: String, | ||
pub if_exists: bool, | ||
} | ||
|
||
impl DropTable { | ||
pub fn new(name: String, if_exists: bool) -> Self { | ||
Self { name, if_exists } | ||
} | ||
} | ||
|
||
impl PhysicalPlan for DropTable { | ||
fn schema(&self) -> arrow::datatypes::SchemaRef { | ||
todo!() | ||
} | ||
|
||
fn execute(&self) -> crate::error::Result<Vec<arrow::array::RecordBatch>> { | ||
todo!() | ||
} | ||
|
||
fn children(&self) -> Option<Vec<std::sync::Arc<dyn PhysicalPlan>>> { | ||
todo!() | ||
} | ||
} |
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,5 @@ | ||
mod create_table; | ||
mod drop_table; | ||
|
||
pub use create_table::*; | ||
pub use drop_table::*; |
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
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,33 @@ | ||
use std::sync::Arc; | ||
|
||
use arrow::array::RecordBatch; | ||
use arrow::datatypes::SchemaRef; | ||
|
||
use crate::error::Result; | ||
use crate::physical::expr::PhysicalExpr; | ||
use crate::physical::plan::PhysicalPlan; | ||
|
||
pub struct Values { | ||
schema: SchemaRef, | ||
exprs: Vec<Vec<Arc<dyn PhysicalExpr>>>, | ||
} | ||
|
||
impl Values { | ||
pub fn new(schema: SchemaRef, exprs: Vec<Vec<Arc<dyn PhysicalExpr>>>) -> Self { | ||
Self { schema, exprs } | ||
} | ||
} | ||
|
||
impl PhysicalPlan for Values { | ||
fn schema(&self) -> SchemaRef { | ||
self.schema.clone() | ||
} | ||
|
||
fn execute(&self) -> Result<Vec<RecordBatch>> { | ||
todo!() | ||
} | ||
|
||
fn children(&self) -> Option<Vec<Arc<dyn PhysicalPlan>>> { | ||
None | ||
} | ||
} |
Oops, something went wrong.