jayzhan211 commented on code in PR #12374:
URL: https://github.com/apache/datafusion/pull/12374#discussion_r1748097339


##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -352,7 +358,18 @@ impl ExprSchemable for Expr {
                     }
                 }
                 WindowFunctionDefinition::AggregateUDF(func) => 
Ok(func.is_nullable()),
-                WindowFunctionDefinition::WindowUDF(udwf) => 
Ok(udwf.nullable()),
+                WindowFunctionDefinition::WindowUDF(udwf) => {
+                    let data_types = args
+                        .iter()
+                        .map(|e| e.get_type(input_schema))
+                        .collect::<Result<Vec<_>>>()?;
+                    let input_types = data_types_with_window_udf(&data_types, 
udwf)?;
+                    let function_name = self.schema_name().to_string();

Review Comment:
   Similar to `self.qualified_name()` in `to_field`, we might have different 
name for Column and Alias?



##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -352,7 +358,18 @@ impl ExprSchemable for Expr {
                     }
                 }
                 WindowFunctionDefinition::AggregateUDF(func) => 
Ok(func.is_nullable()),
-                WindowFunctionDefinition::WindowUDF(udwf) => 
Ok(udwf.nullable()),
+                WindowFunctionDefinition::WindowUDF(udwf) => {
+                    let data_types = args
+                        .iter()
+                        .map(|e| e.get_type(input_schema))
+                        .collect::<Result<Vec<_>>>()?;
+                    let input_types = data_types_with_window_udf(&data_types, 
udwf)?;

Review Comment:
   I think we should handle this compute in `to_field`. 
`data_types_with_window_udf` could reuse `to_field`. `data_types` and 
`nullable` could reuse `data_types_with_window_udf`



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