geoffreyclaude opened a new pull request, #22559: URL: https://github.com/apache/datafusion/pull/22559
## Summary This draft PR proposes one possible fix for [apache/datafusion#22557](https://github.com/apache/datafusion/issues/22557): add an explicit `ExecutionPlan::transparent_child()` hook for wrapper nodes that want their wrapped plan type to remain visible through `ExecutionPlan` downcasting. The implementation keeps the new DataFusion 54 `Any`-based downcast helpers, but changes `dyn ExecutionPlan::is::<T>()` and `downcast_ref::<T>()` to: - check the concrete plan first, so wrappers can still identify as themselves; - then follow `transparent_child()` when the concrete type does not match; - stop if no transparent child is provided. This restores an opt-in version of the transparent-wrapper behavior that was previously possible by overriding `ExecutionPlan::as_any`. ## API naming I used `transparent_child()` because it is short and lines up with the existing “transparent node” wording around execution plans. The docs call out that this hook is only for type introspection and is independent from `children()`, so it should not be used for traversal or optimizer rewrites. This is only a suggested implementation for the linked issue. Other solution proposals, including different API names or a different shape for the hook, are very welcome. ## Tests Added coverage for: - downcasting through a single transparent wrapper; - preserving the wrapper’s own concrete type identity; - downcasting through nested transparent wrappers. ## Validation - `cargo test -p datafusion-physical-plan execution_plan_downcast` - `cargo test -p datafusion-physical-plan --lib` - `cargo fmt --all -- --check` - `git diff --check` -- 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]
