kosiew commented on code in PR #23981:
URL: https://github.com/apache/datafusion/pull/23981#discussion_r3711306051


##########
datafusion/physical-plan/src/projection.rs:
##########
@@ -143,6 +143,34 @@ impl ProjectionExec {
         Self::try_from_projector(projector, input)
     }
 
+    /// Create a projection using field and schema metadata from
+    /// `projected_schema`.
+    ///
+    /// Field names, data types, and nullability are still derived from the 
physical
+    /// projection expressions and the input plan; only field and schema 
metadata are
+    /// taken from `projected_schema`.
+    ///
+    /// # Errors
+    ///
+    /// Returns an error if the projection cannot be applied to the input 
plan, or if
+    /// `projected_schema` has a different number of fields than the 
projection.
+    pub fn try_new_with_schema_metadata<I, E>(

Review Comment:
   Could we add a focused unit test for `try_new_with_schema_metadata`? It 
would be helpful to assert the exact output schema and field metadata, while 
also confirming that the expression-derived name, type, and nullability remain 
unchanged. The planner regression test covers the aggregate failure, but a 
constructor-level test would document this API's metadata-only contract and 
test it independently of aggregate validation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to