Repository navigation
proto: add proto converter reference to PhysicalExtensionCodec trait - #21055
Conversation
9383cdf to
8a86ed0
Compare
…mic filter deduping to work in custom plan nodes
c5b5d44 to
6dc8faf
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 |
adriangb
left a comment
There was a problem hiding this comment.
Currently this is a breaking change. Would you be okay holding it until we release DF 54? Either way if we keep a breaking change (or add new recommended methods) we should add a note the upgrade guide.
| buf: &[u8], | ||
| inputs: &[Arc<dyn ExecutionPlan>], | ||
| _ctx: &TaskContext, | ||
| _proto_converter: &dyn PhysicalProtoConverterExtension, |
There was a problem hiding this comment.
We could add new methods with the param that default to the old methods to avoid a breaking change. Did you consider that as an option?
| &self, | ||
| _node: Arc<dyn ExecutionPlan>, | ||
| _buf: &mut Vec<u8>, | ||
| _proto_converter: &dyn PhysicalProtoConverterExtension, |
There was a problem hiding this comment.
Naming these converter would match try_from_physical_plan_with_converter and make the arg name shorter.
| buf.as_ref(), | ||
| &inputs, | ||
| task_ctx.as_ref(), | ||
| &DefaultPhysicalProtoConverter {}, |
There was a problem hiding this comment.
@timsaucer not sure if you have any suggestions but I think this is fine. Generally we have not made any effort to make dynamic filters / expr deduplication work with plans that go through FFI.
|
@adriangb TYFR! If possible, we would prefer v54 to unblock datafusion-distributed. If we merge, the breaking change would go out in v54.0.0 correct? The change is pretty opt-in, the new parameter in the trait can be safely ignored. |
Yes and my concern with merging this right before the release is that no one will get a chance to test it and if there are issues we are locked into a 6 month deprecation process. |
|
54 branch has been cut, lets merge this! |
…pache#21055) ## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> - Closes apache#21056 ## Rationale for this change Custom `ExecutionPlan` nodes that store `PhysicalExpr` fields cannot participate in expression deduplication during serialization because `PhysicalExtensionCodec::try_encode`/`try_decode` lack access to the `PhysicalProtoConverterExtension`. ## What changes are included in this PR? - Added `proto_converter: &dyn PhysicalProtoConverterExtension` parameter to `PhysicalExtensionCodec::try_decode` and `try_encode` - Updated all implementations: `DefaultPhysicalExtensionCodec`, `ComposedPhysicalExtensionCodec`, `ForeignPhysicalExtensionCodec` (FFI), and all examples - Updated call sites in `PhysicalPlanNode` serialization/deserialization - FFI bridge passes `DefaultPhysicalProtoConverter` as a fallback ## Are these changes tested? Yes — added `test_custom_node_with_dynamic_filter_dedup_roundtrip` which verifies that a `DynamicFilterPhysicalExpr` shared between a `FilterExec` and a custom `ExecutionPlan` node preserves its shared inner state after a roundtrip through `DeduplicatingProtoConverter`. ## Are there any user-facing changes? Breaking API change: `PhysicalExtensionCodec::try_decode` and `try_encode` now take an additional `&dyn PhysicalProtoConverterExtension` parameter. All custom codec implementations must be updated.
Which issue does this PR close?
PhysicalProtoConverterExtensiontoPhysicalExtensionCodec#21056Rationale for this change
Custom
ExecutionPlannodes that storePhysicalExprfields cannot participate in expression deduplication during serialization becausePhysicalExtensionCodec::try_encode/try_decodelack access to thePhysicalProtoConverterExtension.What changes are included in this PR?
proto_converter: &dyn PhysicalProtoConverterExtensionparameterto
PhysicalExtensionCodec::try_decodeandtry_encodeDefaultPhysicalExtensionCodec,ComposedPhysicalExtensionCodec,ForeignPhysicalExtensionCodec(FFI),and all examples
PhysicalPlanNodeserialization/deserializationDefaultPhysicalProtoConverteras a fallbackAre these changes tested?
Yes — added
test_custom_node_with_dynamic_filter_dedup_roundtripwhichverifies that a
DynamicFilterPhysicalExprshared between aFilterExecand a custom
ExecutionPlannode preserves its shared inner state after aroundtrip through
DeduplicatingProtoConverter.Are there any user-facing changes?
Breaking API change:
PhysicalExtensionCodec::try_decodeandtry_encodenow take an additional
&dyn PhysicalProtoConverterExtensionparameter.All custom codec implementations must be updated.