proto: add proto converter reference to PhysicalExtensionCodec trait#21055
proto: add proto converter reference to PhysicalExtensionCodec trait#21055jayshrivastava wants to merge 5 commits into
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.
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.