-
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.
# OPTD Engine Implementation This PR implements the OPTD engine that serves as the interface between the DSL and the optimizer driver. The engine provides the essential APIs for rule application, cost model integration, and catalog access that drive the exploration process. It enables efficient query plan transformations while managing the complexity of multiple possible transformation paths.
- Loading branch information
Showing
87 changed files
with
3,292 additions
and
1,897 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,74 @@ | ||
use super::groups::{RelationalGroupId, ScalarGroupId}; | ||
use ordered_float::OrderedFloat; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)] | ||
pub enum OperatorData { | ||
Int64(i64), | ||
Float64(OrderedFloat<f64>), | ||
String(String), | ||
Bool(bool), | ||
Struct(String, Vec<OperatorData>), | ||
Array(Vec<OperatorData>), | ||
} | ||
|
||
impl OperatorData { | ||
pub fn as_str(&self) -> Option<&str> { | ||
match self { | ||
OperatorData::String(s) => Some(s), | ||
_ => None, | ||
} | ||
} | ||
|
||
pub fn as_bool(&self) -> Option<bool> { | ||
match self { | ||
OperatorData::Bool(b) => Some(*b), | ||
_ => None, | ||
} | ||
} | ||
|
||
pub fn as_i64(&self) -> Option<i64> { | ||
match self { | ||
OperatorData::Int64(i) => Some(*i), | ||
_ => None, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub enum Children<T> { | ||
Singleton(T), | ||
VarLength(Vec<T>), | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub enum PartialLogicalPlan { | ||
PartialMaterialized { | ||
tag: String, | ||
data: Vec<OperatorData>, | ||
relational_children: Vec<Children<PartialLogicalPlan>>, | ||
scalar_children: Vec<Children<PartialScalarPlan>>, | ||
}, | ||
UnMaterialized(RelationalGroupId), | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub enum PartialScalarPlan { | ||
PartialMaterialized { | ||
tag: String, | ||
data: Vec<OperatorData>, | ||
scalar_children: Vec<Children<PartialScalarPlan>>, | ||
}, | ||
UnMaterialized(ScalarGroupId), | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub enum PartialPhysicalPlan { | ||
PartialMaterialized { | ||
tag: String, | ||
data: Vec<OperatorData>, | ||
relational_children: Vec<Children<PartialPhysicalPlan>>, | ||
scalar_children: Vec<Children<PartialScalarPlan>>, | ||
}, | ||
UnMaterialized(RelationalGroupId), | ||
} |
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,6 +1,7 @@ | ||
pub mod expressions; | ||
pub mod goal; | ||
pub mod groups; | ||
pub mod ir; | ||
pub mod memo; | ||
pub mod properties; | ||
|
||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.