Skip to content

Commit

Permalink
update for api change
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Jun 30, 2024
1 parent 374cd00 commit b71dbc1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions datafusion-examples/examples/analyzer_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ use std::sync::{Arc, Mutex};
/// See [optimizer_rule.rs] for an example of a optimizer rule
#[tokio::main]
pub async fn main() -> Result<()> {
// AnalyzerRules run before OptimizerRuless.
// AnalyzerRules run before OptimizerRules.
//
// DataFusion includes several built in AnalyzerRules for tasks such as type
// coercion which change the types of expressions in the plan. Add our new
// rule to the context to run it during the analysis phase.
let rule = Arc::new(RowLevelAccessControl::new());
let ctx = SessionContext::new().add_analyzer_rule(Arc::clone(&rule) as _);
let ctx = SessionContext::new();
ctx.add_analyzer_rule(Arc::clone(&rule) as _);

ctx.register_batch("employee", employee_batch())?;

Expand Down

0 comments on commit b71dbc1

Please sign in to comment.