comphead commented on code in PR #9686:
URL: https://github.com/apache/arrow-datafusion/pull/9686#discussion_r1530678850


##########
datafusion/physical-plan/src/windows/mod.rs:
##########
@@ -174,20 +174,15 @@ fn create_built_in_window_expr(
     name: String,
     ignore_nulls: bool,
 ) -> Result<Arc<dyn BuiltInWindowFunctionExpr>> {
-    // need to get the types into an owned vec for some reason
-    let input_types: Vec<_> = args
-        .iter()
-        .map(|arg| arg.data_type(input_schema))
-        .collect::<Result<_>>()?;
+    // derive the output datatype from incoming schema
+    let out_data_type: &DataType = 
input_schema.field_with_name(&name)?.data_type();

Review Comment:
   Thanks @mustafasrepo for clarification, I would also like to add the part 
were `fun.report_type()` called for window builtin functions in logical planner 
https://github.com/apache/arrow-datafusion/blob/b87dd6143c2dc089b07f74780bd525c4369e68a3/datafusion/expr/src/expr_schema.rs#L184
   
   So when physical layer gets called all the metadata(names, datatypes) is 
already known



-- 
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]

Reply via email to