From ae9a846cb0e9847be0698e19be6944c08af3a008 Mon Sep 17 00:00:00 2001 From: Rohan Krishnaswamy Date: Mon, 3 Nov 2025 12:03:45 -0800 Subject: [PATCH] feat: Expose `DefaultPhysicalPlanner::create_project_physical_exec` --- datafusion/core/src/physical_planner.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/datafusion/core/src/physical_planner.rs b/datafusion/core/src/physical_planner.rs index c280b50a9f07..fc9709d82164 100644 --- a/datafusion/core/src/physical_planner.rs +++ b/datafusion/core/src/physical_planner.rs @@ -2344,7 +2344,25 @@ impl DefaultPhysicalPlanner { Ok(mem_exec) } - fn create_project_physical_exec( + /// Creates a physical [`ProjectionExec`] from logical projection expressions. + /// + /// This method converts logical projection expressions into physical expressions, + /// handling column name mapping between logical and physical schemas. It also + /// detects and plans asynchronous expressions (e.g., async UDFs) by wrapping them + /// in an [`AsyncFuncExec`] when needed. + /// + /// # Arguments + /// + /// * `session_state`: The session state for accessing configuration and resources + /// * `input_exec`: The physical execution plan providing input data + /// * `input`: The logical plan corresponding to the input execution plan + /// * `expr`: The logical projection expressions to convert + /// + /// # Returns + /// + /// A [`ProjectionExec`] for synchronous expressions, or a [`ProjectionExec`] + /// wrapping an [`AsyncFuncExec`] when async expressions are detected. + pub fn create_project_physical_exec( &self, session_state: &SessionState, input_exec: Arc,