koopatroopa787 opened a new pull request, #22637:
URL: https://github.com/apache/datafusion/pull/22637
## Which issue does this PR close?
Closes #22429
## Rationale for this change
`TryCastExpr` serialization/deserialization lived in the central downcast
chains in `to_proto.rs` and `from_proto.rs`. This PR moves it into
self-contained `try_to_proto` / `try_from_proto` hooks on `TryCastExpr` itself,
following the pattern established for `NotExpr`, `NegativeExpr`, `IsNullExpr`,
`IsNotNullExpr`, and `Literal`.
## What changes are included in this PR?
- `datafusion/physical-expr/src/expressions/try_cast.rs`
- Added `#[cfg(feature = "proto")] fn try_to_proto(...)` inside `impl
PhysicalExpr for TryCastExpr`
- Added `#[cfg(feature = "proto")] impl TryCastExpr { pub fn
try_from_proto(...) }`
- Added `proto_tests` module covering: encode, encode-error propagation,
decode, reject-wrong-variant, missing-expr, missing-arrow-type, and
decode-error propagation
- `datafusion/proto/src/physical_plan/to_proto.rs`
- Removed the `TryCastExpr` downcast arm; removed `TryCastExpr` from
import list
- `datafusion/proto/src/physical_plan/from_proto.rs`
- Replaced the inline `ExprType::TryCast` arm with
`TryCastExpr::try_from_proto(proto, &decode_ctx)?`
## Are there any user-facing changes?
No. Serialization behaviour is identical; only the code location changed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]