viirya commented on code in PR #8920:
URL: https://github.com/apache/arrow-datafusion/pull/8920#discussion_r1462474931
##########
datafusion/core/src/physical_planner.rs:
##########
@@ -719,14 +720,16 @@ impl DefaultPhysicalPlanner {
}
let logical_input_schema = input.schema();
- let physical_input_schema = input_exec.schema();
+ // Extend the schema to include window expression fields
as builtin window functions derives its datatype from incoming schema
+ let mut window_fields =
logical_input_schema.fields().clone();
+
window_fields.extend_from_slice(&exprlist_to_fields(window_expr.iter(),
input)?);
+ let extended_schema =
&DFSchema::new_with_metadata(window_fields, HashMap::new())?;
let window_expr = window_expr
.iter()
.map(|e| {
create_window_expr(
e,
- logical_input_schema,
- &physical_input_schema,
+ extended_schema,
Review Comment:
Why do you need to recompute this `extended_schema` which looks like the
same of window operator's schema? You can simply get the window's schema.
--
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]