jcsherin commented on code in PR #12374:
URL: https://github.com/apache/datafusion/pull/12374#discussion_r1748094081
##########
datafusion/physical-plan/src/windows/mod.rs:
##########
@@ -73,7 +74,15 @@ pub fn schema_add_window_field(
.iter()
.map(|e| Arc::clone(e).as_ref().nullable(schema))
.collect::<Result<Vec<_>>>()?;
- let window_expr_return_type = window_fn.return_type(&data_types,
&nullability)?;
+ let window_expr_return_type =
+ if let WindowFunctionDefinition::WindowUDF(udwf) = window_fn {
+ let field_args = WindowUDFFieldArgs::new(&data_types, fn_name);
+
+ udwf.field(field_args)
+ .map(|field| field.data_type().clone())?
+ } else {
+ window_fn.return_type(&data_types, &nullability)?
+ };
Review Comment:
Window UDF derives data type through `field`.
--
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]