You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sub-issue of #22418. Port DynamicFilterPhysicalExpr to own its protobuf (de)serialization via the try_to_proto / try_from_proto hooks added in #21929. This is the original motivator (#21807) — the goal is not just the hooks but deleting the pub-for-proto scaffolding they were added to support.
Reference: copy the Column migration in #21929. Mind the asymmetry — try_to_proto is a trait override, try_from_proto is an inherent fn.
Add try_to_protoinside the impl PhysicalExpr for DynamicFilterPhysicalExpr block (trait override), feature-gated #[cfg(feature = "proto")]. ⚠️ Not an inherent impl method — the serializer dispatches through &dyn PhysicalExpr, so an inherent method is silently never called.
Add DynamicFilterPhysicalExpr::try_from_proto(node, ctx) and wire it into the matching ExprType::… arm in from_proto.rs.
In this same PR, delete the DynamicFilterPhysicalExpr arms from both to_proto.rs and from_proto.rs. Deleting the arm is the only proof the hook is reached.
expr_id matters here — this is the one expression that sets it. Make sure try_to_proto preserves it via the encode ctx and that expression IDs stay stable across a roundtrip.
Tests
The three existing dynamic-filter roundtrip tests must still pass, especially test_dynamic_filter_expression_id_is_stable_between_serializations.
Add a direct hook test covering both directions and a bad-input case (wrong expr_type / missing child → clean error).
#[cfg(test)] mod tests at the end of the file (clippy items-after-test-module).
Sub-issue of #22418. Port
DynamicFilterPhysicalExprto own its protobuf (de)serialization via thetry_to_proto/try_from_protohooks added in #21929. This is the original motivator (#21807) — the goal is not just the hooks but deleting thepub-for-proto scaffolding they were added to support.Reference: copy the
Columnmigration in #21929. Mind the asymmetry —try_to_protois a trait override,try_from_protois an inherent fn.Where it lives
datafusion/physical-expr/src/expressions/dynamic_filters.rs(cratedatafusion-physical-expr).Steps
try_to_protoinside theimpl PhysicalExpr for DynamicFilterPhysicalExprblock (trait override), feature-gated#[cfg(feature = "proto")].implmethod — the serializer dispatches through&dyn PhysicalExpr, so an inherent method is silently never called.DynamicFilterPhysicalExpr::try_from_proto(node, ctx)and wire it into the matchingExprType::…arm infrom_proto.rs.DynamicFilterPhysicalExprarms from bothto_proto.rsandfrom_proto.rs. Deleting the arm is the only proof the hook is reached.pub-for-proto scaffolding from proto: serialize and dedupe dynamic filters v2 #21807 in this same PR —Inner,from_parts,inner(),original_children,remapped_children. Now that decode reads the state directly, these should disappear. Deferring this defeats the purpose of the issue. (A ready-to-cherry-pick commit was posted on PR refactor: addtry_to_proto/try_from_prototoDynamicFilterPhysicalExpr#22452.)expr_idmatters here — this is the one expression that sets it. Make suretry_to_protopreserves it via the encodectxand that expression IDs stay stable across a roundtrip.Tests
test_dynamic_filter_expression_id_is_stable_between_serializations.expr_type/ missing child → clean error).#[cfg(test)] mod testsat the end of the file (clippyitems-after-test-module).Before you push
cargo fmt --allandcargo clippy --all-targets --all-features -- -D warningsmust pass.Checklist
try_to_protoin theimpl PhysicalExprblock (not inherent),#[cfg(feature="proto")]try_from_protowired intofrom_proto.rsto_proto.rs+from_proto.rsarms deleted in this PRInner/from_parts/inner()/original_children/remapped_childrenreverted in this PRexpr_idpreserved; expression-id-stability test passesfmt+clippy -D warningsclean; PR template filled in