Skip to content

Commit

Permalink
datafusion-federation/exampels: remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
hozan23 committed Sep 22, 2024
1 parent 20310ee commit 79bf58b
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions datafusion-federation/examples/df-csv-advanced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,8 @@ async fn main() {
// Get the default optimizer rules
let mut rules = Optimizer::new().rules;

// Create a new rule for the federation optimizer
let federation_rule = Arc::new(FederationOptimizerRule::new());

// Insert the FederationOptimizerRule after the ScalarSubqueryToJoin.
// This ensures ScalarSubquery are replaced before we try to federate.
let optimizer_rule_pos = rules
.iter()
.position(|x| x.name() == "scalar_subquery_to_join")
.expect("Could not locate ScalarSubqueryToJoin");
// Insert the FederationOptimizerRule into the rules
rules.insert(optimizer_rule_pos + 1, federation_rule);
// Create a new federation optimizer rule and add it to the default rules
rules.push(Arc::new(FederationOptimizerRule::new()));

// Create a new SessionState with the optimizer rule we created above
let state = SessionStateBuilder::new()
Expand Down

0 comments on commit 79bf58b

Please sign in to comment.