Skip to content

Commit

Permalink
add comment and missing rule
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmedal committed Sep 11, 2024
1 parent d12cada commit 5aca1ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions wren-modeling-rs/core/src/mdl/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub async fn create_ctx_with_mdl(
reset_default_catalog_schema.clone().read().deref().clone(),
)
.with_analyzer_rules(vec![
// expand the view should be the first rule
Arc::new(ExpandWrenViewRule::new(
Arc::clone(&analyzed_mdl),
Arc::clone(&reset_default_catalog_schema),
Expand Down
6 changes: 6 additions & 0 deletions wren-modeling-rs/core/src/mdl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use log::{debug, info};
use parking_lot::RwLock;
use std::{collections::HashMap, sync::Arc};

use crate::logical_plan::analyze::expand_view::ExpandWrenViewRule;
use crate::logical_plan::analyze::model_anlayze::ModelAnalyzeRule;
use crate::logical_plan::analyze::model_generation::ModelGenerationRule;
use crate::logical_plan::utils::from_qualified_name_str;
Expand Down Expand Up @@ -262,6 +263,11 @@ pub async fn apply_wren_rules(
ctx: &SessionContext,
analyzed_wren_mdl: Arc<AnalyzedWrenMDL>,
) -> Result<()> {
// expand the view should be the first rule
ctx.add_analyzer_rule(Arc::new(ExpandWrenViewRule::new(
Arc::clone(&analyzed_wren_mdl),
ctx.state_ref(),
)));
ctx.add_analyzer_rule(Arc::new(ModelAnalyzeRule::new(
Arc::clone(&analyzed_wren_mdl),
ctx.state_ref(),
Expand Down

0 comments on commit 5aca1ea

Please sign in to comment.