koopatroopa787 opened a new pull request, #22636:
URL: https://github.com/apache/datafusion/pull/22636
## Which issue does this PR close?
Closes #22427
## Rationale for this change
`Literal` 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 `Literal` itself, following the
pattern established for `NotExpr`, `NegativeExpr`, `IsNullExpr`, and
`IsNotNullExpr`.
## What changes are included in this PR?
- `datafusion/physical-expr/src/expressions/literal.rs`
- Added `#[cfg(feature = "proto")] fn try_to_proto(...)` inside `impl
PhysicalExpr for Literal`
- Added `#[cfg(feature = "proto")] impl Literal { pub fn
try_from_proto(...) }`
- Added `proto_tests` module with encode, null-literal, roundtrip, and
reject-wrong-variant tests
- `datafusion/proto/src/physical_plan/to_proto.rs`
- Removed the `Literal` downcast arm; removed `Literal` from import list
- `datafusion/proto/src/physical_plan/from_proto.rs`
- Replaced the inline `ExprType::Literal` arm with
`Literal::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]