feichai0017 opened a new pull request, #22569:
URL: https://github.com/apache/datafusion/pull/22569

   ## Which issue does this PR close?
   
   - Closes #22428.
   
   ## Rationale for this change
   
   `CastExpr` protobuf serialization is currently handled by the central 
physical expression downcast chain. This PR migrates it to the per-expression 
`try_to_proto` / `try_from_proto` hooks, following the existing `Column` / 
`LikeExpr` pattern.
   
   ## What changes are included in this PR?
   
   - Adds `CastExpr::try_to_proto` in the `impl PhysicalExpr for CastExpr` 
block.
   - Adds inherent `CastExpr::try_from_proto` for decoding `PhysicalCastNode`.
   - Routes `ExprType::Cast` decoding through the new hook.
   - Removes the old central `CastExpr` serialization arm from `to_proto.rs`.
   - Adds direct hook tests for successful encode/decode and bad-input cases.
   
   ## Are these changes tested?
   
   Yes:
   
   ```bash
   cargo fmt --all
   cargo test -p datafusion-physical-expr --features proto cast --lib
   cargo test -p datafusion-proto --test proto_integration
   cargo clippy -p datafusion-physical-expr --features proto --lib --tests -- 
-D warnings
   git diff --check
   ```
   
   ## Are there any user-facing changes?
   
   No. The protobuf wire format for `CastExpr` remains unchanged.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to