Skip to content

Commit

Permalink
remove unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed Aug 18, 2023
1 parent 28fdd6e commit 77098fb
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions query_engine/src/datafusion_impl/logical_optimizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,3 @@ use query_frontend::plan::QueryPlan;
use snafu::ResultExt;

use crate::error::*;

/// LogicalOptimizer transform the QueryPlan into a potentially more efficient
/// plan
pub trait LogicalOptimizer {
// TODO(yingwen): Maybe support other plans
fn optimize(&mut self, plan: QueryPlan) -> Result<QueryPlan>;
}

pub struct LogicalOptimizerImpl {
ctx: SessionContext,
}

impl LogicalOptimizerImpl {
pub fn with_context(ctx: SessionContext) -> Self {
Self { ctx }
}
}

impl LogicalOptimizer for LogicalOptimizerImpl {
fn optimize(&mut self, plan: QueryPlan) -> Result<QueryPlan> {
// TODO(yingwen): Avoid clone the plan multiple times during optimization
let QueryPlan {
mut df_plan,
tables,
} = plan;
df_plan = self
.ctx
.state()
.optimize(&df_plan)
.box_err()
.context(LogicalOptimizerWithCause { msg: None })?;

Ok(QueryPlan { df_plan, tables })
}
}

0 comments on commit 77098fb

Please sign in to comment.