-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58734ba
commit 8503379
Showing
17 changed files
with
325 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
use super::{Schema, Select, TimeSeria, Union}; | ||
use super::{Schema, Select, TimeSeries, Union}; | ||
use crate::planner::sql_templates::PlanSqlTemplates; | ||
use cubenativeutils::CubeError; | ||
use std::rc::Rc; | ||
|
||
pub enum QueryPlan { | ||
Select(Rc<Select>), | ||
Union(Rc<Union>), | ||
TimeSeria(Rc<TimeSeria>), | ||
TimeSeries(Rc<TimeSeries>), | ||
} | ||
|
||
impl QueryPlan { | ||
pub fn make_schema(&self, self_alias: Option<String>) -> Schema { | ||
match self { | ||
QueryPlan::Select(select) => select.make_schema(self_alias), | ||
QueryPlan::Union(union) => union.make_schema(self_alias), | ||
QueryPlan::TimeSeria(seria) => seria.make_schema(self_alias), | ||
QueryPlan::TimeSeries(series) => series.make_schema(self_alias), | ||
} | ||
} | ||
pub fn to_sql(&self, templates: &PlanSqlTemplates) -> Result<String, CubeError> { | ||
match self { | ||
QueryPlan::Select(s) => s.to_sql(templates), | ||
QueryPlan::Union(u) => u.to_sql(templates), | ||
QueryPlan::TimeSeria(seria) => seria.to_sql(templates), | ||
QueryPlan::TimeSeries(series) => series.to_sql(templates), | ||
} | ||
} | ||
} |
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
Oops, something went wrong.