Repository navigation
Conversation
…ee function `register_execution_plan::<T>(&mut registry)` and `register_physical_expr::<T>(&mut registry)` become provided methods on the traits the extension already implements: `T::register(&mut registry)`. The crate that defines `T` already imports the trait to implement it, so it needs no other import, and the two kinds have the same call. With `SessionConfig::update_extension`, registration needs no import of `ProtoDecoderRegistry` either: `config.update_extension(MyExec::register)?`. The docs, the 56.0.0 upgrade guide and the `extension_plan_registry` example use this form, for plans and for expressions. The method cannot be inherent on `ProtoDecoderRegistry`: that type is in `datafusion-proto-models`, which cannot name `ExecutionPlan` or `PhysicalExpr`. Both free functions were added for 56.0.0, which is not released, so they are removed and not deprecated. A built-in still cannot be registered: it does not implement the trait, so `FilterExec::register` and `Column::register` do not exist. The `compile_fail` doctests move to the new methods. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adriangb
force-pushed
the
register-method
branch
from
October 21, 2026 19:13
374d2ae to
0c16f8a
Compare
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
Contributor
Author
It is compatible with the last release, the parts we are breaking have not been released yet. |
Contributor
Author
|
@gabotechs curious what you think! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
ExecutionPlans to decode via a per-type registry instead ofPhysicalExtensionCodec#24631, feat: allow extensionPhysicalExprs to decode via a per-type registry #24628 and feat: addSessionConfig::update_extensionso libraries can share oneProtoDecoderRegistry#26353. No separate issue.Rationale for this change
To register an extension type, a library must import a free function for each kind, in addition to the trait it already implements:
What changes are included in this PR?
ExtensionPlanFromProtoandExtensionExprFromProtoget a provided method,fn register(registry: &mut ProtoDecoderRegistry) -> Result<()>. It has the same behavior as the free functions: registering one type twice is a no-op, and a name collision or an empty name is an error.register_execution_planandregister_physical_exprare removed. They were added for 56.0.0, which is not released, so there is nothing to deprecate.extension_plan_registryexample and the 56.0.0 upgrade guide use the new method. They register withconfig.update_extension(T::register)from feat: addSessionConfig::update_extensionso libraries can share oneProtoDecoderRegistry#26353, for plans and for expressions. Before this PR, the expression docs still said to attach the registry withwith_extension.The method cannot be an inherent method on
ProtoDecoderRegistry: that type is indatafusion-proto-models, which cannot nameExecutionPlanorPhysicalExpr.A built-in still cannot be registered. It does not implement the trait, so
FilterExec::registerandColumn::registerdo not exist. Thecompile_faildoctests that check this moved to the new methods.What is the testing strategy for this PR?
No behavior changes. The existing tests now call the method:
proto::registryunit tests indatafusion-physical-plan(6 pass).expr_registryandextensionsindatafusion-proto(20 pass).compile_faildoctests onExtensionPlanFromProto::registerandExtensionExprFromProto::register, and theextension_plan_registryexample.Are there any user-facing changes?
Yes, to API that is not released yet:
register_execution_plan::<T>(&mut registry)is nowT::register(&mut registry), and the same forregister_physical_expr. The 56.0.0 upgrade guide is updated.🤖 Generated with Claude Code