zhuqi-lucas opened a new pull request, #25357: URL: https://github.com/apache/datafusion/pull/25357
## Which issue does this PR close? Closes #25316. ## Rationale for this change `OptimizationInvariantChecker` consults `schema_check()` on the rule the optimizer holds. For a rule that runs *other* rules inside its own `optimize()` — an instrumentation wrapper, a conditional wrapper, a rule that fuses a short sequence — the optimizer never sees the inner rules, only the wrapper. Returning `false` from such a wrapper therefore disables schema validation for everything it wraps, including rules that explicitly opted in. Nothing warns at registration or at run time; validation simply stops happening, and the loss only surfaces if a schema-changing regression happens to hit that path. I walked into this myself: `false` looked correct because each wrapped rule had its own `schema_check()`, but those values are never consulted once the rules are inside a wrapper. ## What changes are included in this PR? A doc comment on `schema_check()` stating the requirement, with the one-line `any()` form, so an implementor reads it where they make the decision. ## Are these changes tested? Documentation only, no behavior change. ## Are there any user-facing changes? Doc only. -- 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]
