use std::sync::Arc;
use async_trait::async_trait;
use datafusion::{
error::Result,
execution::context::{QueryPlanner, SessionState},
logical_expr::LogicalPlan,
physical_plan::ExecutionPlan,
physical_planner::PhysicalPlanner,
};
use super::exon_physical_planner::ExonPhysicalPlanner;
#[derive(Debug, Default)]
pub struct ExonQueryPlanner {}
#[async_trait]
impl QueryPlanner for ExonQueryPlanner {
async fn create_physical_plan(
&self,
logical_plan: &LogicalPlan,
session_state: &SessionState,
) -> Result<Arc<dyn ExecutionPlan>> {
let physical_planner = ExonPhysicalPlanner::default();
physical_planner
.create_physical_plan(logical_plan, session_state)
.await
}
}