LiaCastaneda commented on code in PR #15580: URL: https://github.com/apache/datafusion/pull/15580#discussion_r2029242588
########## datafusion/core/src/physical_planner.rs: ########## @@ -2061,6 +2066,36 @@ fn tuple_err<T, R>(value: (Result<T>, Result<R>)) -> Result<(T, R)> { } } +// Handle the case where the name of a physical column expression does not match the corresponding physical input fields names. +// Physical column names are derived from the physical schema, whereas physical column expressions are derived from the logical column names. +// +// This is a special case that applies only to column expressions. Logical plans may slightly modify column names by appending a suffix (e.g., using ':'), +// to avoid duplicates—since DFSchemas do not allow duplicate names. For example: `count(Int64(1)):1`. +fn maybe_fix_physical_column_name( + expr: Result<Arc<dyn PhysicalExpr>>, + input_physical_schema: &SchemaRef, +) -> Result<Arc<dyn PhysicalExpr>> { Review Comment: the rename happens [here](https://github.com/apache/datafusion/blob/5a335b828d0425c7c38bb40b80e8b900203ac468/datafusion/expr/src/logical_plan/builder.rs#L1479) in the logical plan builder to avoid errors while building the logical plan. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org