alamb commented on code in PR #10410: URL: https://github.com/apache/datafusion/pull/10410#discussion_r1595387773
########## datafusion/expr/src/logical_plan/plan.rs: ########## @@ -467,6 +468,200 @@ impl LogicalPlan { self.with_new_exprs(self.expressions(), inputs.to_vec()) } + /// Recomputes schema and type information for this LogicalPlan if needed. + /// + /// Some `LogicalPlan`s may need to recompute their schema if the number or + /// type of expressions have been changed (for example due to type + /// coercion). For example [`LogicalPlan::Projection`]s schema depends on + /// its expressions. + /// + /// Some `LogicalPlan`s schema is unaffected by any changes to their + /// expressions. For example [`LogicalPlan::Filter`] schema is always the + /// same as its input schema. + /// + /// # Return value + /// Returns an error if there is some issue recomputing the schema. + /// + /// # Notes + /// + /// * Does not recursively recompute schema for input (child) plans. + pub fn recompute_schema(self) -> Result<Self> { Review Comment: I pushed bd7b62f2aa76e33a4fcba7cffaf02920114192bb to try and clarify -- 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