-
Notifications
You must be signed in to change notification settings - Fork 2k
Allow fine-tune planner steps #11715
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
The planning phase generates and optimizes both logical and physical plans. IIRC we only provide one method to "optimize and create" a physical plan:
datafusion/datafusion/core/src/execution/session_state.rs
Lines 715 to 723 in a721be1
| pub async fn create_physical_plan( | |
| &self, | |
| logical_plan: &LogicalPlan, | |
| ) -> datafusion_common::Result<Arc<dyn ExecutionPlan>> { | |
| let logical_plan = self.optimize(logical_plan)?; | |
| self.query_planner | |
| .create_physical_plan(&logical_plan, self) | |
| .await | |
| } |
Describe the solution you'd like
There are two approaches to alleviate this:
- Expose more methods that each one only does one step, like
create_logical_plan,analyze_logical_plan,optimize_logical_plan,create_physical_planandoptimize_physical_planetc. - Expose those components to users, like
/// Returns the [`Analyzer`] for this session
pub fn analyzer(&self) -> &Analyzer {
&self.analyzer
}
/// Returns the [`Optimizer`] for this session
pub fn optimizer(&self) -> &Optimizer {
&self.optimizer
}
/// Returns the [`QueryPlanner`] for this session
pub fn query_planner(&self) -> &Arc<dyn QueryPlanner + Send + Sync> {
&self.query_planner
}Describe alternatives you've considered
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Fields
Give feedbackNo fields configured for issues without a type.