Skip to content

Commit 9a91c42

Browse files
committed
prototype: finalize encode dispatch; drop the migration guide (apache#22419)
The downcast chain collapsed incrementally as each plan migrated; this finishes the encode path by removing the redundant second delegate resolution. The superseded per-plan PhysicalPlanNodeExt methods are deliberately KEPT (deprecated in the next commit) per the API health policy, instead of the wholesale deletion this commit previously did.
1 parent dde32d0 commit 9a91c42

2 files changed

Lines changed: 6 additions & 166 deletions

File tree

‎MIGRATION_GUIDE.md‎

Lines changed: 0 additions & 152 deletions
This file was deleted.

‎datafusion/proto/src/physical_plan/mod.rs‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -891,31 +891,23 @@ pub trait PhysicalPlanNodeExt: Sized {
891891
let plan_clone = Arc::clone(&plan);
892892
let mut plan = plan.as_ref();
893893
// Resolve the downcast identity first so wrapper plans serialize as
894-
// their delegate, matching how the `downcast_ref` chain below sees
895-
// them. Without this a wrapper around a migrated plan would hit the
896-
// wrapper's default `try_to_proto` (`Ok(None)`) and find no fallback
897-
// arm for the delegate.
894+
// their delegate, matching how `downcast_ref`-based dispatch sees
895+
// them. Without this a wrapper around a self-serializing plan would
896+
// hit the wrapper's default `try_to_proto` (`Ok(None)`) and fall
897+
// through to the extension codec.
898898
while let Some(delegate) = plan.downcast_delegate() {
899899
plan = delegate;
900900
}
901901

902902
// Self-serializing plans handle themselves via the `try_to_proto` hook
903903
// (#22419). `Ok(None)` means "not migrated" and falls through to the
904-
// central downcast chain below.
905-
//
906-
// The hook is a trait method dispatched on the concrete type, so — like
907-
// the `downcast_ref::<T>()` arms below — it must first follow
908-
// `downcast_delegate()` so a wrapper plan serializes as its delegate.
904+
// remaining special cases and the extension-codec fallback below.
909905
let encoder = ConverterPlanEncoder {
910906
codec,
911907
proto_converter,
912908
};
913909
let encode_ctx = ExecutionPlanEncodeCtx::new(&encoder);
914-
let mut hook_target = plan;
915-
while let Some(delegate) = hook_target.downcast_delegate() {
916-
hook_target = delegate;
917-
}
918-
if let Some(node) = hook_target.try_to_proto(&encode_ctx)? {
910+
if let Some(node) = plan.try_to_proto(&encode_ctx)? {
919911
return Ok(node);
920912
}
921913

0 commit comments

Comments
 (0)