adriangb opened a new pull request, #27570: URL: https://github.com/apache/datafusion/pull/27570
## Which issue does this PR close? Follow-up to https://github.com/apache/datafusion/pull/26274. This PR is stacked on it: only the last commit belongs to this PR. Review https://github.com/apache/datafusion/pull/26274 first. ## Rationale for this change https://github.com/apache/datafusion/pull/26274 makes the `schema` and `projection` fields of `MaterializedCteScan` private, so that they always match. The `MaterializedCte` node still has public fields. A rule that builds the node with a struct literal or a struct update skips the scan check in `MaterializedCte::try_new`. ## What changes are included in this PR? - The fields of `MaterializedCte` are `pub(crate)`. Downstream code reads them through `id()`, `name()`, `body()` and `continuation()`. - New `MaterializedCte::inputs_mut` and `MaterializedCte::into_inputs` replace the direct field access in the optimizer driver, `TypeCoercion`, `DecorrelatePredicateSubquery`, `PushDownFilter`, `OptimizeProjections` and the physical planner. - Rules that rebuild the node from owned inputs call `try_new`, so the scans are checked. ## Are these changes tested? Yes, by the existing tests. The change does not change behavior. ## Are there any user-facing changes? Yes. This is a breaking API change, which the 57.0.0 upgrade guide describes. -- 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]
